Skip to content

Commit 66d16a1

Browse files
authored
fix: # comment handling in populate script (#1430)
1 parent 22af3e6 commit 66d16a1

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

api/src/scripts/populate_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self, filepaths):
6060
filepaths = [filepaths]
6161

6262
for filepath in filepaths:
63-
new_df = pandas.read_csv(filepath, comment="#", low_memory=False)
63+
new_df = pandas.read_csv(filepath, low_memory=False)
6464
self.df = pandas.concat([self.df, new_df])
6565

6666
self.filter_data()
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
# The contents of this file will be added to the database after the sources_test.csv of the parent directories.
2-
# So we can replicate some feeds here that are a slight change from the ones in the parent source_test.csv
3-
# and see the effect.
4-
# We want to make sure the is_official flag is handled properly in that case.
5-
# Normally changing to True or False should change the original value but changing to an empty cell should not
61
mdb_source_id,data_type,entity_type,location.country_code,location.subdivision_name,location.municipality,provider,is_official,name,note,feed_contact_email,static_reference,urls.direct_download,urls.authentication_type,urls.authentication_info,urls.api_key_parameter_name,urls.latest,urls.license,location.bounding_box.minimum_latitude,location.bounding_box.maximum_latitude,location.bounding_box.minimum_longitude,location.bounding_box.maximum_longitude,location.bounding_box.extracted_on,status,features,redirect.id,redirect.comment
7-
# For mdb-40, change is_official from TRUE to empty. Should retain True
82
40,gtfs,,CA,Ontario,London,London Transit Commission,,,,[email protected],,http://www.londontransit.ca/gtfsfeed/google_transit.zip,0,,,https://storage.googleapis.com/storage/v1/b/mdb-latest/o/ca-ontario-london-transit-commission-gtfs-2.zip?alt=media,https://www.londontransit.ca/open-data/ltcs-open-data-terms-of-use/,42.905244,43.051188,-81.36311,-81.137591,2022-02-22T19:51:34+00:00,inactive,,,
9-
# For mdb-50, change is_official from FALSE to empty. Should retain False
103
50,gtfs,,CA,Ontario,Barrie,ZBarrie Transit,,,,,,http://www.myridebarrie.ca/gtfs/Google_transit.zip,,,,https://storage.googleapis.com/storage/v1/b/mdb-latest/o/ca-ontario-barrie-transit-gtfs-3.zip?alt=media,https://www.barrie.ca/services-payments/transportation-parking/barrie-transit/barrie-gtfs,44.3218044,44.42020676,-79.74063237,-79.61089569,2022-03-01T22:43:25+00:00,deprecated,,40|mdb-702,Some|Comment
11-
# For mdb-1562, change is_official from FALSE to TRUE. Should change to True
124
1562,gtfs-rt,sa,CA,BC,Vancouver,Vancouver-Transit(éèàçíóúČ),TRUE,Realtime(ŘŤÜÎ),,,40,http://foo.org/google_transit.zip,0,,,,,,,,,,active,,10,
13-
# For mdb-1563, change is_official from TRUE to FALSE. Should change to False
145
1563,gtfs-rt,tu,US,SomeState,SomeCity,SomeCity Bus,FALSE,RT,,,mdb-50,http://bar.com,0,,,,,,,,,,inactive,,10,
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# We want to test the populate when there is already stuff in the DB and we rerun
2-
# with changes in systems.csv
31
Country Code,Name,Location,System ID,URL,Auto-Discovery URL,Supported Versions,Authentication Info URL, Authentication Type,Authentication Parameter Name
4-
# Feed 1 stays the same
52
AE,Feed 1,Dubai,feed_1,https://www.careem.com/en-ae/careem-bike/,https://some_url/gbfs.json,1.1 ; 2.3,,,
6-
# Feed 2 was removed. We expect it to be made deprecated in the DB
7-
# Feed 3 was modified (Name will be Feed 3 modified instead of Feed 3)
83
AE,Feed 3 modified,Dubai,feed_3,https://www.careem.com/en-ae/careem-bike/,https://some_url/gbfs.json,1.1 ; 2.3,,,
9-
# Feed 4 was added
104
AE,Feed 4,Dubai,feed_4,https://ridedott.com/,https://some_url/gbfs.json,2.3,,,

0 commit comments

Comments
 (0)