Skip to content

Conversation

@cka-y
Copy link
Contributor

@cka-y cka-y commented Nov 19, 2024

Summary:
This PR introduces the capability to filter feeds by their official status within the API. The implementation includes updates to existing methods, modifications to test data, and new test cases to ensure proper functionality.

Enhancements to Feeds Filtering:

  • feeds_api_impl.py:
    • Added a new helper method _get_latest_official_status_subquery to facilitate filtering based on the latest official status.
    • Updated methods to include is_official as a filter parameter.

Updates to Models and Filters:

  • basic_feed_impl.py:
    • Modified the from_orm method to include the latest official status.
    • Added joinedload for officialstatushistories to optimize queries. [1] [2]
  • search_api_impl.py:
    • Enhanced search queries to include is_official as a filter.
    • Improved functionality across multiple filter-related methods. [1] [2] [3] [4]

Testing Instructions:

  1. Create a tunnel to the development database.
  2. Run the API locally.
  3. Validate the filtering functionality by making requests to endpoints like:
    http://127.0.0.1:8080/v1/gtfs_feeds?official=true
    
    Ensure that the behavior matches expectations.

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)

@cka-y cka-y linked an issue Nov 19, 2024 that may be closed by this pull request
@cka-y cka-y changed the title feat: added official param to endpoint and responses feat: added official in endpoint params and responses Nov 19, 2024
@cka-y cka-y changed the title feat: added official in endpoint params and responses feat: added official value in endpoint params and responses Nov 19, 2024
@github-actions
Copy link

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-833-tphc44tp.web.app

@cka-y cka-y marked this pull request as draft November 20, 2024 16:01
@cka-y cka-y marked this pull request as ready for review November 25, 2024 21:13
Copy link
Contributor

@qcdyx qcdyx left a comment

Choose a reason for hiding this comment

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

LGTM - I tested the code locally and got 200 response.

@cka-y cka-y merged commit 814887b into main Dec 13, 2024
6 of 7 checks passed
@cka-y cka-y deleted the feat/794 branch December 13, 2024 19:41
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.

Add official tag to endpoints

3 participants