Skip to content

Commit c568ce9

Browse files
authored
fix: support redirect as string (#903)
1 parent 4a0ba9f commit c568ce9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api/src/scripts/populate_db_gtfs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ def process_redirects(self, session: "Session"):
159159
comment = comments.pop(0)
160160
else:
161161
comment = ""
162-
163-
target_stable_id = f"mdb-{int(float(mdb_source_id.strip()))}"
162+
try:
163+
target_stable_id = f"mdb-{int(float(mdb_source_id.strip()))}"
164+
except ValueError:
165+
target_stable_id = mdb_source_id.strip()
164166
target_feed = self.query_feed_by_stable_id(session, target_stable_id, None)
165167
if not target_feed:
166168
self.logger.warning(f"Could not find redirect target feed {target_stable_id} for feed {stable_id}")

0 commit comments

Comments
 (0)