OpenClimate
OpenClimate copied to clipboard
fix(OC-1375): fix bug that prevents imports when data directory ends with slash
Issue is resolved and confirmed I can import to the database when data directory ends with a slash:
python3 import_openclimate_data.py /var/local/harmonize/data/processed/ISO-3166-1/
or doesn't end with a slash:
python3 import_openclimate_data.py /var/local/harmonize/data/processed/ISO-3166-2
@lgloege what do we need to do to close this?
@evanp , the import script has been changed since PR. To fix this issue we just need to change the way we build paths.
change:
p = Path(dir + "/" + table + ".csv")
to this:
p = Path(dir) / f'{table}.csv'
This is the recommended way to build paths and it resolves our issue.