Skip to content

Commit

Permalink
fix: support redirect as string (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
cka-y authored Feb 4, 2025
1 parent 4a0ba9f commit c568ce9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/src/scripts/populate_db_gtfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ def process_redirects(self, session: "Session"):
comment = comments.pop(0)
else:
comment = ""

target_stable_id = f"mdb-{int(float(mdb_source_id.strip()))}"
try:
target_stable_id = f"mdb-{int(float(mdb_source_id.strip()))}"
except ValueError:
target_stable_id = mdb_source_id.strip()
target_feed = self.query_feed_by_stable_id(session, target_stable_id, None)
if not target_feed:
self.logger.warning(f"Could not find redirect target feed {target_stable_id} for feed {stable_id}")
Expand Down

0 comments on commit c568ce9

Please sign in to comment.