Skip to content

Conversation

@jonperron
Copy link
Owner

Changelog:

  • Add requests objects for pt APIs
  • Update functions used to call APIs to use requests objects rather than dictionnaries
  • Update tests

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors public transportation API methods to use typed request objects instead of dictionaries for parameter passing. The change improves type safety and reduces code duplication by consolidating filter logic in a base class.

  • Introduces new request classes for each PT entity type (VehicleJourney, StopPoint, StopArea, Route, etc.)
  • Refactors API client methods to accept a single BasePTEntityRequest parameter instead of multiple individual parameters
  • Updates all tests to instantiate and pass the appropriate request objects

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
navitia_client/entities/request/base_entity_request.py Adds to_filters() method to convert request object to dictionary
navitia_client/entities/request/public_transportations/*.py New request classes for each PT entity type
navitia_client/entities/request/public_transportations/__init__.py Exports all request classes
navitia_client/entities/request/public_transportations/___init__.py Duplicate file with incorrect filename (triple underscores)
navitia_client/client/apis/public_transportation_apis/*.py Refactored to use request objects instead of individual parameters
tests/client/apis/public_transportation_apis/*.py Updated to instantiate and use new request objects

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Changelog:
* Add requests objects for pt APIs
* Update functions used to call APIs to use requests objects rather than dictionnaries
* Update tests
@jonperron jonperron force-pushed the feat/request-ptobjects-refactor branch from 6137b2c to ac72f4d Compare November 11, 2025 13:14
@jonperron jonperron merged commit dffc073 into main Nov 11, 2025
5 checks passed
@jonperron jonperron deleted the feat/request-ptobjects-refactor branch November 11, 2025 13:15
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