Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow s3_output in athena.to_iceberg #2727

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions awswrangler/athena/_write_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def to_iceberg(
merge_cols: list[str] | None = None,
keep_files: bool = True,
data_source: str | None = None,
s3_output: str | None = None,
workgroup: str = "primary",
mode: Literal["append", "overwrite", "overwrite_partitions"] = "append",
encryption: str | None = None,
Expand Down Expand Up @@ -288,6 +289,8 @@ def to_iceberg(
Whether staging files produced by Athena are retained. 'True' by default.
data_source : str, optional
Data Source / Catalog name. If None, 'AwsDataCatalog' will be used by default.
s3_output : str, optional
Amazon S3 path used for query execution.
workgroup : str
Athena workgroup. Primary by default.
mode: str
Expand Down Expand Up @@ -498,6 +501,7 @@ def to_iceberg(
wg_config=wg_config,
database=database,
data_source=data_source,
s3_output=s3_output,
encryption=encryption,
kms_key=kms_key,
boto3_session=boto3_session,
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_athena_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def test_athena_to_iceberg(
def test_athena_to_iceberg_append(
path: str,
path2: str,
path3: str,
glue_database: str,
glue_table: str,
partition_cols: list[str] | None,
Expand Down Expand Up @@ -102,6 +103,7 @@ def test_athena_to_iceberg_append(
partition_cols=partition_cols,
keep_files=False,
mode="append",
s3_output=path3,
)

df_actual = wr.athena.read_sql_query(
Expand Down
Loading