Skip to content

Commit

Permalink
fix: Typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Nov 9, 2023
1 parent dc1afc9 commit 638d5d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion posthog/temporal/workflows/postgres_batch_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async def create_table_in_postgres(
# This is safe as we are hardcoding the type values anyways.
sql.SQL("{field} {type}").format(
field=sql.Identifier(field),
type=sql.SQL(field_type), # type: ignore
type=sql.SQL(field_type),
)
for field, field_type in fields
),
Expand Down
6 changes: 3 additions & 3 deletions posthog/temporal/workflows/redshift_batch_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ async def insert_records_to_redshift(
if len(batch) < batch_size:
continue

await cursor.execute_many(cursor, query, batch, template)
await cursor.executemany(cursor, query, batch, template)
batch = []

if len(batch) > 0:
await cursor.execute_many(cursor, query, batch, template)
await cursor.executemany(cursor, query, batch, template)


@dataclass
Expand Down Expand Up @@ -148,7 +148,7 @@ async def insert_into_redshift_activity(inputs: RedshiftInsertInputs):
properties_type = "VARCHAR(65535)" if inputs.properties_data_type == "varchar" else "SUPER"

async with postgres_connection(inputs) as connection:
create_table_in_postgres(
await create_table_in_postgres(
connection,
schema=inputs.schema,
table_name=inputs.table_name,
Expand Down

0 comments on commit 638d5d1

Please sign in to comment.