Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'stop_time_update' #2

Open
mhgwilliams opened this issue Jul 3, 2019 · 1 comment
Open

KeyError: 'stop_time_update' #2

mhgwilliams opened this issue Jul 3, 2019 · 1 comment

Comments

@mhgwilliams
Copy link

I've tried a few github projects using the mta api and am running into the same issue in multiple.
When running in normal configuration, nothing changed, I get this error:

Traceback (most recent call last):
  File "mta_notification.py", line 46, in <module>
    station_time_lookup(realtime_data, 'R36N')
  File "mta_notification.py", line 37, in station_time_lookup
    unique_arrival_times = unique_train_schedule['stop_time_update'] # arrival_times is a list of arrivals
KeyError: 'stop_time_update'

This is some sort of dictionary error, but I don't understand why it doesn't see this key when I can see it fine when printing that data.

Is it something to do with processing power? I'm running this on a Raspberry pi zero, quite low powered.

@effeappbw
Copy link

I've found one potential cause/band-aid, but I'm not experienced enough to fix the bug. Increasing the time interval in the following line helped me:

Change the following line
if time_until_train > 3: to if time_until_train > 10:

However, increasing it too much, say to 20 mins, results in the same error.

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

No branches or pull requests

2 participants