Skip to content

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

Open
lgloege wants to merge 1 commit intodevelopfrom
OC-1375
Open

fix(OC-1375): fix bug that prevents imports when data directory ends with slash#20
lgloege wants to merge 1 commit intodevelopfrom
OC-1375

Conversation

@lgloege
Copy link
Contributor

@lgloege lgloege commented Dec 20, 2022

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

@evanp
Copy link
Contributor

evanp commented Mar 13, 2023

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

@lgloege
Copy link
Contributor Author

lgloege commented Mar 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants