This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push:
new e4c1748f Emit warnings instead of failing when seeing unsupported
configuration (#1111)
e4c1748f is described below
commit e4c1748fee220076f04e35ab2f182dd51ca20705
Author: Fokko Driesprong <[email protected]>
AuthorDate: Thu Aug 29 22:11:51 2024 +0200
Emit warnings instead of failing when seeing unsupported configuration
(#1111)
---
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 df9f9098..999813d0 100644
--- a/pyiceberg/io/pyarrow.py
+++ b/pyiceberg/io/pyarrow.py
@@ -32,6 +32,7 @@ import logging
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 5fd12846..ce5b1474 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)