Skip to content

Commit

Permalink
restore original destination for write path
Browse files Browse the repository at this point in the history
  • Loading branch information
jorritsandbrink committed Dec 14, 2024
1 parent fcf65ec commit 2557226
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/load/filesystem/test_sql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def arrow_all_types():
pipeline.run(source(), loader_file_format=destination_config.file_format)

if alternate_access_pipeline:
orig_dest = pipeline.destination
pipeline.destination = alternate_access_pipeline.destination

import duckdb
Expand Down Expand Up @@ -185,6 +186,9 @@ def _fs_sql_client_for_external_db(
with fs_sql_client as sql_client:
sql_client.create_views_for_tables({"arrow_all_types": "arrow_all_types"})
assert external_db.sql("FROM second.arrow_all_types;").arrow().num_rows == total_records
if alternate_access_pipeline:
# switch back for the write path
pipeline.destination = orig_dest
pipeline.run( # run pipeline again to add rows to source table
source().with_resources("arrow_all_types"),
loader_file_format=destination_config.file_format,
Expand Down

0 comments on commit 2557226

Please sign in to comment.