Skip to content

Commit

Permalink
MM-57990: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ifoukarakis committed Apr 29, 2024
1 parent d07cd08 commit 5d93afd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/utils/db/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_should_upload_file_to_table(mocker):
call('TRUNCATE TABLE test-schema.a-table'),
call('CREATE TEMPORARY STAGE IF NOT EXISTS test-schema.a-table'),
call('PUT file:///tmp/upload.csv @test-schema.a-table OVERWRITE=TRUE'),
call('COPY INTO test-schema.a-table FROM @test-schema.a-table FILE_FORMAT = (TYPE = CSV SKIP_HEADER = 1)'),
call("COPY INTO test-schema.a-table FROM @test-schema.a-table FILE_FORMAT = (TYPE = CSV SKIP_HEADER = 1 FIELD_OPTIONALLY_ENCLOSED_BY = '\"')"), # noqa: E501
]
)

Expand Down
2 changes: 1 addition & 1 deletion utils/db/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def upload_csv_as_table(engine: Engine, file: str, schema: str, table: str) -> N
"""
# Truncate table, upload file and replace table content's within a transaction.
with engine.begin() as conn:
conn.execute(f"TRUNCATE TABLE IF EXISTS {schema}.{table}")
conn.execute(f"TRUNCATE TABLE {schema}.{table}")
conn.execute(f"CREATE TEMPORARY STAGE IF NOT EXISTS {schema}.{table}")
conn.execute(f"PUT file://{file} @{schema}.{table} OVERWRITE=TRUE")
conn.execute(
Expand Down

0 comments on commit 5d93afd

Please sign in to comment.