Skip to content

Commit

Permalink
feat(bq-syncer): add conditional export and deletion operations
Browse files Browse the repository at this point in the history
  • Loading branch information
daoleno committed Jan 15, 2024
1 parent 6b82088 commit 1b5f3ed
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bq-syncer/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,15 @@ def perform_sync_task():

is_task_running = False

# export tables to parquet files
output_directory = create_output_directory()
export_tables(conn, output_directory)
update_symbolic_link(output_directory)
if args.output:
# export tables to parquet files
output_directory = create_output_directory()
export_tables(conn, output_directory)
update_symbolic_link(output_directory)

# Add this new deletion operation after updating the symbolic link.
delete_old_dir()

# Add this new deletion operation after updating the symbolic link.
delete_old_dir()
print(f"[{datetime.now()}] Data sync completed.")

except Exception as e:
Expand Down

0 comments on commit 1b5f3ed

Please sign in to comment.