Skip to content

Commit

Permalink
Emit warnings instead of failing when seeing unsupported configuration (
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko authored Aug 29, 2024
1 parent 86728e2 commit e4c1748
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_writes/test_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit e4c1748

Please sign in to comment.