Skip to content

Commit

Permalink
make copy_from_source_schema an actual arg
Browse files Browse the repository at this point in the history
  • Loading branch information
floptical committed Oct 3, 2024
1 parent ce20929 commit becfa61
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions databridge_etl_tools/db2/db2_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@click.option('--table_name', required=True)
@click.option('--account_name', required=True)
@click.option('--enterprise_schema', required=True)
@click.option('--copy_from_source_schema', required=True)
@click.option('--libpq_conn_string', required=True)
def db2(ctx, **kwargs):
'''Run ETL commands for DB2'''
Expand All @@ -17,12 +18,5 @@ def db2(ctx, **kwargs):
@click.pass_context
def copy_dept_to_enterprise(ctx, **kwargs):
"""Copy from the dept table directly to an enterpise able in a single transaction that can roll back if it fails."""
db2 = Db2(**ctx.obj, **kwargs, copy_from_source_schema=ctx.obj['account_name'])
db2.copy_to_enterprise()

@db2.command()
@click.pass_context
def copy_staging_to_enterprise(ctx, **kwargs):
"""Copies from etl_staging to the specified enterprise authoritative dataset."""
db2 = Db2(**ctx.obj, **kwargs, copy_from_source_schema='etl_staging')
db2 = Db2(**ctx.obj, **kwargs)
db2.copy_to_enterprise()

0 comments on commit becfa61

Please sign in to comment.