Skip to content

Commit

Permalink
[python] Deprecate tiledb.Filter getters in PlatformConfig (#2720)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Jun 12, 2024
1 parent a9eb694 commit 12d5af5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions apis/python/src/tiledbsoma/options/_tiledb_create_options.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from typing import (
Any,
Dict,
Expand All @@ -20,6 +21,8 @@

import tiledb

from .._general_utilities import assert_version_before

# Most defaults are configured directly as default attribute values
# within TileDBCreateOptions.
DEFAULT_TILE_EXTENT = 2048
Expand Down Expand Up @@ -194,10 +197,25 @@ def cell_tile_orders(self) -> Tuple[Optional[str], Optional[str]]:

def offsets_filters_tiledb(self) -> Tuple[tiledb.Filter, ...]:
"""Constructs the real TileDB Filters to use for offsets."""
assert_version_before(1, 14)
warnings.warn(
"`offsets_filters_tiledb` is now deprecated for removal in 1.14 "
"as we no longer support returning tiledb.Filter. "
"Use `offsets_filters` instead.",
DeprecationWarning,
)

return tuple(_build_filter(f) for f in self.offsets_filters)

def validity_filters_tiledb(self) -> Optional[Tuple[tiledb.Filter, ...]]:
"""Constructs the real TileDB Filters to use for the validity map."""
assert_version_before(1, 14)
warnings.warn(
"`validity_filters_tiledb` is now deprecated for removal in 1.14 "
"as we no longer support returning tiledb.Filter. "
"Use `validity_filters` instead.",
DeprecationWarning,
)
if self.validity_filters is None:
return None
return tuple(_build_filter(f) for f in self.validity_filters)
Expand All @@ -206,6 +224,13 @@ def dim_filters_tiledb(
self, dim: str, default: Sequence[_FilterSpec] = ()
) -> Tuple[tiledb.Filter, ...]:
"""Constructs the real TileDB Filters to use for the named dimension."""
assert_version_before(1, 14)
warnings.warn(
"`dim_filters_tiledb` is now deprecated for removal in 1.14 "
"as we no longer support returning tiledb.Filter. "
"Use `dims` instead.",
DeprecationWarning,
)
return _filters_from(self.dims, dim, default)

def dim_tile(self, dim_name: str, default: int = DEFAULT_TILE_EXTENT) -> int:
Expand All @@ -220,6 +245,13 @@ def attr_filters_tiledb(
self, name: str, default: Sequence[_FilterSpec] = ()
) -> Tuple[tiledb.Filter, ...]:
"""Constructs the real TileDB Filters to use for the named attribute."""
assert_version_before(1, 14)
warnings.warn(
"`attr_filters_tiledb` is now deprecated for removal in 1.14 "
"as we no longer support returning tiledb.Filter. "
"Use `attrs` instead.",
DeprecationWarning,
)
return _filters_from(self.attrs, name, default)


Expand Down

0 comments on commit 12d5af5

Please sign in to comment.