Skip to content

Commit 8cac6c4

Browse files
committed
modified features to exclude optional endpoints
1 parent da2f19c commit 8cac6c4

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

functions-python/gbfs_validator/src/gbfs_data_processor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from shared.database.database import with_db_session
3131
from shared.helpers.utils import create_http_task
3232

33+
EXCLUDED_OPTIONAL_ENDPOINTS = ["station_information", "system_hours", "system_calendar"]
34+
3335

3436
class GBFSDataProcessor:
3537
def __init__(self, stable_id: str, feed_id: str):
@@ -291,7 +293,9 @@ def update_or_create_gbfs_endpoint(
291293
)
292294

293295
gbfs_endpoint_orm.url = endpoint.url # Update the URL
294-
gbfs_endpoint_orm.is_feature = endpoint.name in features
296+
gbfs_endpoint_orm.is_feature = (
297+
endpoint.name in features not in EXCLUDED_OPTIONAL_ENDPOINTS
298+
)
295299
return gbfs_endpoint_orm
296300

297301
def validate_gbfs_feed_versions(self) -> None:

liquibase/changelog.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@
5353
<!-- Materialized view updated. Used Feed.official field as official status. -->
5454
<include file="changes/feat_1083.sql" relativeToChangelogFile="true"/>
5555
<include file="changes/feat_1132.sql" relativeToChangelogFile="true"/>
56+
<include file="changes/feat_1125.sql" relativeToChangelogFile="true"/>
5657
</databaseChangeLog>

liquibase/changes/feat_1125.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Update gbfsendpoint table to set is_feature = false for specific endpoints
2+
UPDATE gbfsendpoint
3+
SET is_feature = false
4+
WHERE name IN ('station_information', 'system_hours', 'system_calendar')
5+
AND is_feature = true;

0 commit comments

Comments
 (0)