Skip to content

fix: latest dataset filter and move db models to shared folder under shared folder#1410

Merged
davidgamez merged 4 commits into
mainfrom
chore/share_db_models
Oct 23, 2025
Merged

fix: latest dataset filter and move db models to shared folder under shared folder#1410
davidgamez merged 4 commits into
mainfrom
chore/share_db_models

Conversation

@davidgamez
Copy link
Copy Markdown
Member

@davidgamez davidgamez commented Oct 22, 2025

Summary:

This PR moves the database models to the shared folder to be able to share these transformations with the Python functions. This PR also fixes a failing latest filtering in the datasets endpoint.

Expected behavior:

  • For all endpoints except gtfs_feeds/<stable_id>/datasets, the API should behave the same as before, with no changes to the previous behaviour .
  • For the gtfs_feeds/<stable_id>/datasets endpoint a valid response in returned.

Testing tips:

Latest dataset fix:

  • Hit the local API instance with the following request, replacing the feed_stable_id with a local ID.
curl --request GET \
  --url 'http://localhost:8080/v1/gtfs_feeds/<stable_id>/datasets?latest=true'
  • You should expect only the latest dataset returned for the specified feed.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@davidgamez davidgamez changed the title chore: move db models to shared folder under shared folder fix: fix latest dataset filter and move db models to shared folder under shared folder Oct 22, 2025
@davidgamez davidgamez marked this pull request as ready for review October 22, 2025 17:30
@davidgamez davidgamez changed the title fix: fix latest dataset filter and move db models to shared folder under shared folder fix: latest dataset filter and move db models to shared folder under shared folder Oct 22, 2025

if latest:
query = query.join(Gtfsdataset.feed).filter(Gtfsdataset.id == FeedOrm.latest_dataset_id)
query = query.join(Gtfsfeed, Gtfsfeed.latest_dataset_id == Gtfsdataset.id)
Copy link
Copy Markdown
Member Author

@davidgamez davidgamez Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the latest dataset filter fix

@davidgamez davidgamez requested a review from cka-y October 22, 2025 19:44
@davidgamez davidgamez merged commit 3457d0f into main Oct 23, 2025
2 of 3 checks passed
@davidgamez davidgamez deleted the chore/share_db_models branch October 23, 2025 20:50
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 this pull request may close these issues.

2 participants