Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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