From 9afe40d187b4c3bc7cbdc517f4e4c0b008e29c18 Mon Sep 17 00:00:00 2001 From: Fokko Date: Wed, 28 Aug 2024 23:27:41 +0200 Subject: [PATCH] Emit warnings instead of failing when seeing unsupported configuration --- pyiceberg/io/pyarrow.py | 3 ++- tests/integration/test_writes/test_writes.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py index df9f90984b..999813d0c2 100644 --- a/pyiceberg/io/pyarrow.py +++ b/pyiceberg/io/pyarrow.py @@ -32,6 +32,7 @@ import os import re import uuid +import warnings from abc import ABC, abstractmethod from concurrent.futures import Future from copy import copy @@ -2544,7 +2545,7 @@ def _get_parquet_writer_kwargs(table_properties: Properties) -> Dict[str, Any]: f"{TableProperties.PARQUET_BLOOM_FILTER_COLUMN_ENABLED_PREFIX}.*", ]: if unsupported_keys := fnmatch.filter(table_properties, key_pattern): - raise NotImplementedError(f"Parquet writer option(s) {unsupported_keys} not implemented") + warnings.warn(f"Parquet writer option(s) {unsupported_keys} not implemented") compression_codec = table_properties.get(TableProperties.PARQUET_COMPRESSION, TableProperties.PARQUET_COMPRESSION_DEFAULT) compression_level = property_as_int( diff --git a/tests/integration/test_writes/test_writes.py b/tests/integration/test_writes/test_writes.py index 5fd12846bd..ce5b1474b0 100644 --- a/tests/integration/test_writes/test_writes.py +++ b/tests/integration/test_writes/test_writes.py @@ -549,7 +549,7 @@ def test_write_parquet_unsupported_properties( identifier = "default.write_parquet_unsupported_properties" tbl = _create_table(session_catalog, identifier, properties, []) - with pytest.raises(NotImplementedError): + with pytest.warns(UserWarning, match=r"Parquet writer option.*"): tbl.append(arrow_table_with_null)