Skip to content

Commit 33a648a

Browse files
committed
Add Note For test_dask_multiattr_2d Filter Warning Ignore
1 parent f54118e commit 33a648a

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

tiledb/query_condition.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class QueryCondition:
8484
``attr ::= <variable> | attr(<str>)``
8585
8686
Values are any Python-valid number or string. datetime64 values should first be
87-
casted to UNIX seconds. Vales may also be casted with ``val()``.
87+
cast to UNIX seconds. Values may also be casted with ``val()``.
8888
8989
``val ::= <num> | <str> | val(val)``
9090
@@ -364,7 +364,7 @@ def cast_val_to_dtype(
364364
if isinstance(val, str):
365365
raise tiledb.TileDBError(f"Cannot cast `{val}` to {dtype}.")
366366
if np.issubdtype(dtype, np.datetime64):
367-
cast = getattr(np, "uint64")
367+
cast = getattr(np, "int64")
368368
else:
369369
cast = getattr(np, dtype)
370370
val = cast(val)
@@ -374,8 +374,8 @@ def cast_val_to_dtype(
374374
return val
375375

376376
def init_pyqc(self, pyqc: PyQueryCondition, dtype: str) -> Callable:
377-
if np.issubdtype(dtype, np.datetime64):
378-
dtype = "uint64"
377+
if dtype != "string" and np.issubdtype(dtype, np.datetime64):
378+
dtype = "int64"
379379

380380
init_fn_name = f"init_{dtype}"
381381

tiledb/tests/test_dask.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@ def _make_multiattr_2d(self, uri, shape=(0, 100), tile=10):
4646

4747
tiledb.DenseArray.create(uri, schema)
4848

49-
@pytest.mark.xfail(
50-
datetime.now() < datetime(2022, 8, 8),
51-
reason=(
52-
"`DeprecationWarning` being thrown by Dask but will be fixed by "
53-
"https://github.com/dask/distributed/issues/6163"
54-
),
55-
)
5649
@pytest.mark.filterwarnings("ignore:There is no current event loop")
57-
@pytest.mark.filterwarnings("ignore:make_current is deprecated")
50+
@pytest.mark.filterwarnings(
51+
# In Python 3.7 on POSIX systems, Hurricane outputs a warning message
52+
# that "make_current is deprecated." This should be fixed by Dask in
53+
# future releases.
54+
"ignore:make_current is deprecated"
55+
)
5856
def test_dask_multiattr_2d(self):
5957
uri = self.path("multiattr")
6058

tiledb/tests/test_query_condition.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ def filter_dense(self, data, mask):
1616
if isinstance(mask, np.ndarray):
1717
mask = mask[0]
1818

19-
if isinstance(mask, float) and np.isnan(mask):
19+
if isinstance(mask, float):
2020
return data[np.invert(np.isnan(data))]
21-
elif np.isnat(mask):
21+
22+
if isinstance(mask, np.timedelta64):
2223
return data[np.invert(np.isnat(data))]
23-
else:
24-
return data[data != mask]
24+
25+
return data[data != mask]
2526

2627
def create_input_array_UIDSA(self, sparse):
2728
path = self.path("input_array_UIDSA")

0 commit comments

Comments
 (0)