Skip to content

Commit

Permalink
Handle invalid 'suuntaselite' field
Browse files Browse the repository at this point in the history
  • Loading branch information
juuso-j committed Dec 4, 2024
1 parent 5afecf3 commit c0717c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eco_counter/management/commands/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ def get_lam_counter_csv(start_date):
station.station_id, direction, start_date, today
)
# Read the direction, e.g., Vaasa
direction_name = df["suuntaselite"].iloc[0]
try:
direction_name = df["suuntaselite"].iloc[0]
except IndexError as e:
logger.warning(f"Discarding station {station} IndexError: {e}")
continue

# From the mappings determine the 'keskustaan päin' or 'poispäin keskustasta' direction.
try:
direction_value = LAM_STATIONS_DIRECTION_MAPPINGS[
Expand Down

0 comments on commit c0717c4

Please sign in to comment.