Commit 00a25029 authored by Micaël Bergeron's avatar Micaël Bergeron

apply feedback

parent 97205438
......@@ -8,8 +8,7 @@ import logging
def write_to_db_from_csv(db_conn, csv_file, *,
primary_key,
table_schema,
table_name,
header_transform=lambda x: x):
table_name):
"""
Write to Postgres DB from a CSV
......@@ -114,8 +113,7 @@ def update_set_stmt(columns):
def upsert_to_db_from_csv(db_conn, csv_file, *,
primary_key,
table_schema,
table_name,
header_transform=lambda x: x):
table_name):
"""
Upsert to Postgres DB from a CSV
......@@ -140,7 +138,7 @@ def upsert_to_db_from_csv(db_conn, csv_file, *,
psycopg2.sql.Identifier("pg_temp"),
tmp_table,
psycopg2.sql.SQL(', ').join(
psycopg2.sql.Identifier(header_transform(n)) for n in header.split(','),
psycopg2.sql.Identifier(n) for n in header.split(','),
),
)
logging.debug(copy_query.as_string(cursor))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment