Skip to content

Commit

Permalink
use relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Dec 7, 2024
1 parent 15d18cf commit 80f2e2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data/base_data_importer/csv_to_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def load_csvs_into_tables(csv_file_list: list[dict]):
for csv_file in csv_file_list:
log.info(f"Truncating table {csv_file['table']}")
cursor.execute("TRUNCATE TABLE \"public\".\"%s\" CASCADE" % (csv_file["table"]))
with open(csv_file["path"], 'r') as f:
current_dir = os.path.dirname(os.path.abspath(__file__))
file_path = os.path.join(current_dir, csv_file["path"])
with open(file_path, 'r') as f:
try:
reader = csv.reader(f)
cols = []
Expand Down

0 comments on commit 80f2e2f

Please sign in to comment.