Skip to content

Commit

Permalink
fix delta table format destination config selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jorritsandbrink committed Aug 1, 2024
1 parent b07dddc commit 65737e7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
17 changes: 11 additions & 6 deletions tests/load/pipeline/test_filesystem_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def foo():
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
all_buckets_filesystem_configs=True,
table_format_filesystem_configs=True,
table_format="delta",
bucket_exclude=(MEMORY_BUCKET),
),
Expand Down Expand Up @@ -312,8 +312,9 @@ def data_types():
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
local_filesystem_configs=True,
table_format_filesystem_configs=True,
table_format="delta",
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down Expand Up @@ -358,8 +359,9 @@ def delta_table():
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
local_filesystem_configs=True,
table_format_filesystem_configs=True,
table_format="delta",
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down Expand Up @@ -434,8 +436,9 @@ def complex_table():
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
local_filesystem_configs=True,
table_format_filesystem_configs=True,
table_format="delta",
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down Expand Up @@ -524,8 +527,9 @@ def delta_table(data):
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
local_filesystem_configs=True,
table_format_filesystem_configs=True,
table_format="delta",
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down Expand Up @@ -572,8 +576,9 @@ def s():
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
local_filesystem_configs=True,
table_format_filesystem_configs=True,
table_format="delta",
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down
17 changes: 14 additions & 3 deletions tests/load/pipeline/test_merge_disposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def skip_if_not_supported(
destinations_configs(
default_sql_configs=True,
all_buckets_filesystem_configs=True,
table_format_filesystem_configs=True,
supports_merge=True,
bucket_subset=(FILE_BUCKET, AZ_BUCKET), # test one local, one remote
),
Expand Down Expand Up @@ -138,7 +139,9 @@ def data(slice_: slice = None):
destinations_configs(
default_sql_configs=True,
local_filesystem_configs=True,
table_format_filesystem_configs=True,
supports_merge=True,
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down Expand Up @@ -248,7 +251,11 @@ def r(data):
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
default_sql_configs=True, local_filesystem_configs=True, supports_merge=True
default_sql_configs=True,
local_filesystem_configs=True,
table_format_filesystem_configs=True,
supports_merge=True,
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down Expand Up @@ -732,7 +739,11 @@ def duplicates_no_child():
@pytest.mark.parametrize(
"destination_config",
destinations_configs(
default_sql_configs=True, local_filesystem_configs=True, supports_merge=True
default_sql_configs=True,
local_filesystem_configs=True,
table_format_filesystem_configs=True,
supports_merge=True,
bucket_subset=(FILE_BUCKET),
),
ids=lambda x: x.name,
)
Expand Down Expand Up @@ -1207,7 +1218,7 @@ def r():
"destination_config",
destinations_configs(
default_sql_configs=True,
local_filesystem_configs=True,
table_format_filesystem_configs=True,
supports_merge=True,
subset=["postgres", "filesystem"], # test one SQL and one non-SQL destination
),
Expand Down
12 changes: 4 additions & 8 deletions tests/load/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def destinations_configs(
all_staging_configs: bool = False,
local_filesystem_configs: bool = False,
all_buckets_filesystem_configs: bool = False,
table_format_filesystem_configs: bool = False,
subset: Sequence[str] = (),
bucket_subset: Sequence[str] = (),
exclude: Sequence[str] = (),
Expand Down Expand Up @@ -494,14 +495,6 @@ def destinations_configs(
supports_merge=False,
)
]
destination_configs += [
DestinationTestConfiguration(
destination="filesystem",
bucket_url=FILE_BUCKET,
table_format="delta",
supports_merge=True,
)
]

if all_buckets_filesystem_configs:
for bucket in DEFAULT_BUCKETS:
Expand All @@ -513,6 +506,9 @@ def destinations_configs(
supports_merge=False,
)
]

if table_format_filesystem_configs:
for bucket in DEFAULT_BUCKETS:
destination_configs += [
DestinationTestConfiguration(
destination="filesystem",
Expand Down

0 comments on commit 65737e7

Please sign in to comment.