OpenClimate icon indicating copy to clipboard operation
OpenClimate copied to clipboard

fix(OC-1375): fix bug that prevents imports when data directory ends with slash

Open lgloege opened this issue 2 years ago • 2 comments

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 avatar Dec 20 '22 16:12 lgloege

@lgloege what do we need to do to close this?

evanp avatar Mar 13 '23 17:03 evanp

@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.

lgloege avatar Mar 15 '23 15:03 lgloege