Skip to content

Commit

Permalink
fix: added country name to gbfs populate script
Browse files Browse the repository at this point in the history
  • Loading branch information
cka-y committed Aug 19, 2024
1 parent 2cc0d59 commit 609aa5f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/scripts/populate_db_gbfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pandas as pd
import pytz
import pycountry

from database.database import generate_unique_id, configure_polymorphic_mappers
from database_gen.sqlacodegen_models import Gbfsfeed, Location, Gbfsversion, Externalid
Expand Down Expand Up @@ -95,6 +96,7 @@ def populate_db(self):
location = self.db.session.get(Location, location_id) or Location(
id=location_id,
country_code=country_code,
country=pycountry.countries.get(alpha_2=country_code).name if country_code else None,
municipality=municipality,
)
gbfs_feed.locations.clear()
Expand Down

0 comments on commit 609aa5f

Please sign in to comment.