Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds logic to detect and remove GBFS feed versions that duplicate the same gbfs endpoint URL across versions.
- Introduces
validate_gbfs_endpoint_url()to check for existing endpoint URLs. - Enhances
extract_endpoints_for_all_versions()to warn about and discard duplicate versions. - Cleans up
self.gbfs_versionsby removing detected duplicates.
Comments suppressed due to low confidence (3)
functions-python/gbfs_validator/src/gbfs_data_processor.py:408
- [nitpick] The method name
validate_gbfs_endpoint_urlimplies an assertion or error; consider renaming to something likeendpoint_exists_across_versionsoris_duplicate_gbfs_endpointto clarify that it returns a boolean check.
def validate_gbfs_endpoint_url(self, endpoint_url: str) -> bool:
functions-python/gbfs_validator/src/gbfs_data_processor.py:449
- The comment is misleading—these versions are being removed due to duplicated
gbfsendpoints, not because of missing endpoints. Please update the comment to reflect the actual reason.
# Remove versions that had no endpoints extracted
functions-python/gbfs_validator/src/gbfs_data_processor.py:408
- New logic for duplicate detection and removal should be covered by unit tests—add tests for
validate_gbfs_endpoint_urland scenarios inextract_endpoints_for_all_versionswhere duplicates are logged and removed.
def validate_gbfs_endpoint_url(self, endpoint_url: str) -> bool:
Contributor
|
@cka-y I still see 2 results for citiz_developpement on prod. Is this expected? Thanks! cc @emmambd
|
Contributor
Author
|
@richfab we haven't release the changes yet so this is expected until we release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary:
This PR introduces enhancements to the GBFS data processor to improve the handling of duplicate GBFS endpoint URLs across different versions. The most important changes include adding a new validation method and updating the endpoint extraction logic to handle duplicates more effectively.
Expected behavior:
extract_endpoints_for_all_versionsto:gbfs_versions.Testing tips:

Result for citiz_developpement
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything