Skip to content

Commit

Permalink
Merge pull request airbytehq#4 from mohamagdy/destination-redshift-no…
Browse files Browse the repository at this point in the history
…-dbt

Fix initializing the Redshift No DBT staging tables
  • Loading branch information
mohamagdy authored Apr 8, 2022
2 parents 8a4a95c + bff5c5e commit 5504100
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
DestinationSyncMode
from dotmap import DotMap
from psycopg2._psycopg import connection as Connection
from psycopg2.pool import ThreadedConnectionPool, SimpleConnectionPool
from psycopg2.pool import SimpleConnectionPool

from destination_redshift_no_dbt.csv_writer import CSVWriter
from destination_redshift_no_dbt.jsonschema_to_tables import JsonToTables, PARENT_CHILD_SPLITTER
Expand Down Expand Up @@ -205,13 +205,13 @@ def _initialize_staging_schema(self):
create_schema_statement = f"CREATE SCHEMA IF NOT EXISTS {staging_schema}"
cursor.execute(create_schema_statement)

for key, table in stream.final_tables.items():
staging_table = deepcopy(table)
staging_table.schema = staging_schema
for key, table in stream.final_tables.items():
staging_table = deepcopy(table)
staging_table.schema = staging_schema

stream.staging_tables[key] = staging_table
stream.staging_tables[key] = staging_table

cursor.execute(staging_table.create_statement(staging=True))
cursor.execute(staging_table.create_statement(staging=True))

def _create_pool(self, config: Mapping[str, Any]):
self.connection_pool = SimpleConnectionPool(
Expand Down

0 comments on commit 5504100

Please sign in to comment.