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

Add redirect field to Python operations #319

Closed
emmambd opened this issue Jan 10, 2024 · 3 comments · Fixed by #333
Closed

Add redirect field to Python operations #319

emmambd opened this issue Jan 10, 2024 · 3 comments · Fixed by #333
Assignees

Comments

@emmambd
Copy link
Contributor

emmambd commented Jan 10, 2024

What problem is your feature request trying to solve?
In #309, redirect was added to the schema and CSV, but not the Python operations. That means right now, if I want to add redirect and still generate the right bounding box I need to

Add a feed via the add_gtfs_schedule_source or add_gtfs_realtime_source operations
Push PR
Modify JSON to include redirect directly
Update PR
rather than add all fields through the operations.

Describe the solution you'd like
Include redirect in Python operations, to add and update gtfs schedule and gtfs realtime feeds.
Include redirect object in schema in README

@emmambd
Copy link
Contributor Author

emmambd commented Feb 15, 2024

@cka-y Looks like the test is validating for a string value, when redirect is a number: 4b71837#diff-92300112b36301d0886c9786601b64e36393c1ae3dd25102b2ce3af4cfb72795.

@emmambd emmambd reopened this Feb 15, 2024
@cka-y
Copy link
Contributor

cka-y commented Feb 15, 2024

Indeed! had to change it to number because of preexisting feeds but forgot to update the tests.

@emmambd
Copy link
Contributor Author

emmambd commented Feb 16, 2024

@cka-y Looks like this is breaking Fred's script:

Traceback (most recent call last):
46 File "", line 2, in
47 File "/home/runner/work/mobility-database-catalogs/mobility-database-catalogs/tools/operations.py", line 142, in add_gtfs_schedule_source
48 catalog.add(**data)
49 File "/home/runner/work/mobility-database-catalogs/mobility-database-catalogs/tools/representations.py", line 168, in add
50 if len(redirects) > 0:
51 ^^^^^^^^^^^^^^
52 TypeError: object of type 'NoneType' has no len()

Are the operations not set up to take the redirect as an optional field? The script run we did last night had 0 redirect fields populated.

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

Successfully merging a pull request may close this issue.

2 participants