Skip to content

Commit 9033322

Browse files
Fix numpy deprecation errors (#502)
Fixes: ``` DeprecationWarning: The 'generic' unit for NumPy timedelta is deprecated, and will raise an error in the future. This includes implicit conversion of bare integers (e.g. `+ 1`).Please use a specific unit instead. ```
2 parents a1eeaa6 + 91c7c49 commit 9033322

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ packages = ["duckdb", "_duckdb"]
333333
strict = true
334334
warn_unreachable = true
335335
pretty = true
336-
python_version = "3.10"
336+
python_version = "3.12"
337337
exclude = [
338338
"duckdb/experimental/", # not checking the pyspark API
339339
"duckdb/query_graph/", # old and unmaintained (should probably remove)

tests/fast/test_all_types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,17 @@ def test_fetchnumpy(self, cur_type):
377377
),
378378
"interval": np.ma.array(
379379
[
380-
np.timedelta64(0),
381-
np.timedelta64(2675722599999999000),
382-
np.timedelta64(42),
380+
np.timedelta64(0, "ns"),
381+
np.timedelta64(2675722599999999000, "ns"),
382+
np.timedelta64(42, "ns"),
383383
],
384384
mask=[0, 0, 1],
385385
),
386386
# For timestamp_ns, the lowest value is out-of-range for numpy,
387387
# such that the conversion yields "Not a Time"
388388
"timestamp_ns": np.ma.array(
389389
[
390-
np.datetime64("NaT"),
390+
np.datetime64("NaT", "ns"),
391391
np.datetime64(9223372036854775806, "ns"),
392392
np.datetime64("1990-01-01T00:42"),
393393
],

0 commit comments

Comments
 (0)