Closed Rikuoja closed 2 years ago
When using gtfs feeds such as the German gtfs feed (https://gtfs.de/de/feeds/de_nv/) or Estonia (http://peatus.ee/gtfs/) with missing shape_ids or other missing fields, import_gtfs crashes with KeyError at https://github.com/Bondify/gtfs_functions/blob/master/gtfs_functions/gtfs_funtions.py#L91
import_gtfs
KeyError
This is due to Pandas not supporting .loc if any of the keys are missing in Pandas 1.0.0 and above: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#indexing-with-list-with-missing-labels-is-deprecated
.loc
Instead, reindex should be used. Will make a PR to fix this.
reindex
Apparently the same issue as https://github.com/Bondify/gtfs_functions/issues/7
When using gtfs feeds such as the German gtfs feed (https://gtfs.de/de/feeds/de_nv/) or Estonia (http://peatus.ee/gtfs/) with missing shape_ids or other missing fields,
import_gtfs
crashes withKeyError
at https://github.com/Bondify/gtfs_functions/blob/master/gtfs_functions/gtfs_funtions.py#L91This is due to Pandas not supporting
.loc
if any of the keys are missing in Pandas 1.0.0 and above: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#indexing-with-list-with-missing-labels-is-deprecatedInstead,
reindex
should be used. Will make a PR to fix this.