Skip to content

Fix copy_map in gtfs_db_to_db copying from the wrong storage - #185

Merged
skinkie merged 1 commit into
MMTIS:binary_relation_serializerfrom
deryclem:fix-copy-map-wrong-storage
Aug 21, 2026
Merged

skinkie merged 1 commit into
MMTIS:binary_relation_serializerfrom
deryclem:fix-copy-map-wrong-storage

Conversation

@deryclem

Copy link
Copy Markdown
Contributor

Fixes #101

copy_map reads via self.iter_only_objects(), so it needs to be called on
the storage holding the source data. gtfs_db_to_db calls it on db_write
instead of db_read, so PassengerStopAssignment/ScheduledStopPoint/StopPlace
etc. lose their outgoing references (or come out empty entirely).
epip_db_to_db.py does the same copy correctly (source_db.copy_map(...),
line 183).

Introduced in e5a8107 during the netexio -> mdbx migration, no test covers
this path. Same root cause as #101 (5t), also reproduced it converting
Trenitalia's NeTEx EPIP feed: stop_times.txt referenced 1935 stop_ids but
stops.txt came out empty.

@skinkie

skinkie commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@skinkie
skinkie merged commit f68c436 into MMTIS:binary_relation_serializer Aug 21, 2026
2 checks passed
@deryclem
deryclem deleted the fix-copy-map-wrong-storage branch August 21, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with 5t: something strange happening to PSA in gtfs_db_to_db.py

2 participants