Skip to content

Commit

Permalink
add log to keep track of which files have finished being copied over
Browse files Browse the repository at this point in the history
  • Loading branch information
yuenmichelle1 committed Oct 19, 2023
1 parent 251f8ed commit b67afe8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/copy_classifications_from_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
with psycopg.connect(f"host={TIMESCALE_CONNECTION} port={TIMESCALE_PORT} dbname={ERAS_DB} user={ERAS_USER} password={ERAS_PW} sslmode=require keepalives=1 keepalives_idle=30 keepalives_interval=10 keepalives_count=20") as timescale_db_conn:
with timescale_db_conn.cursor(name="timescale_cursor").copy("COPY classification_events FROM STDIN DELIMITER ',' CSV HEADER") as timescale_copy:
timescale_copy.write(open(f"prod_classifications_{output_file_no}.csv").read())
print("FINISHED COPYING FILE #", output_file_no)
output_file_no += 1

finish_time = datetime.now()
Expand Down

0 comments on commit b67afe8

Please sign in to comment.