Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kounelisagis committed Dec 9, 2024
1 parent 14b274d commit 9a69c87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tiledb/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import tiledb
from tiledb.libtiledb import version as libtiledb_version

from .main import PyFragmentInfo

"""
Classes and functions relating to TileDB fragments.
"""
Expand Down Expand Up @@ -105,6 +103,8 @@ def __init__(self, array_uri, include_mbrs=False, ctx=None):

self.array_uri = array_uri

from .main import PyFragmentInfo

fi = PyFragmentInfo(self.array_uri, schema, include_mbrs, ctx)

self.__nums = fi.get_num_fragments()
Expand Down
15 changes: 9 additions & 6 deletions tiledb/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Optional, Sequence, Union

import tiledb.libtiledb as lt
from tiledb import TileDBError

from .array import Array
from .ctx import Ctx, CtxMixin, default_ctx
Expand Down Expand Up @@ -63,7 +62,7 @@ def __init__(
raise ValueError("Cannot pass both dims and has_coords=True to Query")

if return_incomplete and not array.schema.sparse:
raise TileDBError(
raise lt.TileDBError(
"Incomplete queries are only supported for sparse arrays at this time"
)

Expand All @@ -82,15 +81,17 @@ def __init__(
domain = array.schema.domain
for dname in dims:
if not domain.has_dim(dname):
raise TileDBError(f"Selected dimension does not exist: '{dname}'")
raise lt.TileDBError(
f"Selected dimension does not exist: '{dname}'"
)
self._dims = dims
else:
self._dims = None

if attrs is not None:
for name in attrs:
if not array.schema.has_attr(name):
raise TileDBError(f"Selected attribute does not exist: '{name}'")
raise lt.TileDBError(f"Selected attribute does not exist: '{name}'")
self._attrs = attrs
self._cond = cond

Expand All @@ -109,7 +110,9 @@ def __init__(
if use_arrow is None:
use_arrow = True
if not use_arrow:
raise TileDBError("Cannot initialize return_arrow with use_arrow=False")
raise lt.TileDBError(
"Cannot initialize return_arrow with use_arrow=False"
)
self._use_arrow = use_arrow

self._return_incomplete = return_incomplete
Expand All @@ -124,7 +127,7 @@ def subarray(self) -> Subarray:

def __getitem__(self, selection):
if self._return_arrow:
raise TileDBError("`return_arrow=True` requires .df indexer`")
raise lt.TileDBError("`return_arrow=True` requires .df indexer`")

return self._array.subarray(
selection,
Expand Down

0 comments on commit 9a69c87

Please sign in to comment.