-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: GTFS related endpoints #90
Conversation
Thanks for opening this pull request! You're awesome. We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of titles with semantic prefixes:
|
Hi @jujiang526 , Thank you for all this! I've refactored it further to reduce code duplication. Also I saw that you were mapping database feed or dataset IDs directly to API IDs. I believe @jcpitre clarified in an earlier meeting that they want us to use stable_id when accepting or returning IDs in API. I've made the changes in the code and verified in my local Postman it works as expected. Though the tests you've added were using these database IDs that are auto-generated in https://github.com/MobilityData/mobility-feed-api/blob/02f2b6f0b2a4dddac51f7e02de220c965e9004f4/api/src/scripts/populate_db.py#L123C1-L123C1 in our locals, so these tests won't pass anywhere else. Do you know which dataset stable ID did you use for these values? |
Found more missing functionality in this PR. The fixes are in https://github.com/MobilityData/mobility-feed-api/tree/arda/add-api-filter with the filtering functionality |
🚨 Do not merge this PR into main, until #94 is reviewed/merged into this branch |
authored-by: arda <arda.turkmen@twosigma.com>
# Conflicts: # api/src/database/database.py
merged and resolved the conflicts from main |
Added #96 to track filtering on dates for feeds. |
@aronza - Can you please try to run the unit test in your environment? I believe I have fixed it. I also fixed a small issue with returning duplicated records from the joined table. |
They pass on my local too @jujiang526 . Though our changes to database class broke @goorui 's unit tests, so I refactored these tests to work with the latest changes |
instance = None | ||
|
||
def __new__(cls, *args, **kwargs): | ||
if not isinstance(cls.instance, cls): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this thread safe?
If not, maybe it's irrelevant to our case. If so, can you add a comment explaining why it's not relevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jujiang526 , I believe you've added this. Any thoughts?
Summary:
Linked Issue
Implemented the following endpoints without supporting filtering or sorting
Get GTFS feeds
Get GTFS RT feeds
Get GTFS feed by ID
Get GTFS RT feed by ID
Get GTFS feed datasets for a given feed ID
Get GTFS datasets by dataset ID
Expected behavior:
Tested all those end points. The performance is good. Added a few unit tests regarding bounding filtering and database join query.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.sh
to make sure you didn't break anything