Skip to content

Commit

Permalink
Testing redirect comment 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpitre committed Oct 26, 2023
1 parent 0f7997e commit 458b1f1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/export_to_csv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
URLS_AUTHENTICATION_TYPE = "urls.authentication_type"
FEATURES = "features"
REDIRECTS = "redirects"
REDIRECTS_COMMENTS = "redirects_comments"
# tools.constants.GTFS_SCHEDULE_CATALOG_PATH_FROM_ROOT
GTFS_SCHEDULE_CATALOG_PATH_FROM_ROOT = "catalogs/sources/gtfs/schedule"
Expand Down Expand Up @@ -114,14 +115,18 @@ jobs:
else:
source[LOCATION] = {COUNTRY_CODE: UNKNOWN, SUBDIVISION_NAME: UNKNOWN, MUNICIPALITY: UNKNOWN}
source[ENTITY_TYPE] = "|".join(source.get(ENTITY_TYPE))
else:
# For redirects, allow strings or integers
if len(source.get(REDIRECTS, [])) > 0:
source[REDIRECTS] = "|".join(str(item) for item in source.get(REDIRECTS))
else:
source[REDIRECTS] = ""
if len(source.get(FEATURES, [])) > 0:
source[FEATURES] = "|".join(source.get(FEATURES))
# For redirects, allow strings or integers
if len(source.get(REDIRECTS, [])) > 0:
source[REDIRECTS] = "|".join(str(item) for item in source.get(REDIRECTS))
else:
source[REDIRECTS] = ""
if len(source.get(REDIRECTS_COMMENTS, [])) > 0:
source[REDIRECTS_COMMENTS] = "|".join(source.get(REDIRECTS_COMMENTS))
catalog[source_id] = source
# Sort the catalog and convert it to a list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"direct_download": "http://data.trilliumtransit.com/gtfs/easternsierra-ca-us/easternsierra-ca-us.zip",
"latest": "https://storage.googleapis.com/storage/v1/b/mdb-latest/o/us-california-eastern-sierra-transit-gtfs-25.zip?alt=media"
},
"redirects": ["25", 26]
"redirects": ["25", 26],
"redirects_comments": ["Comment for redirect 25", "Comment for redirect 26"]

}
4 changes: 2 additions & 2 deletions schemas/gtfs_schedule_source_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@
"type": "string"
}
},
"redirects_comment": {
"redirects_comments": {
"type": "string",
"description": "A optional comment explaining the nature of the redirect(s)."
"description": "Optional comments explaining the nature of the redirect(s)."
}
},
"required": ["mdb_source_id", "data_type", "provider", "location", "urls"]
Expand Down

0 comments on commit 458b1f1

Please sign in to comment.