pydiverse-common 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/PKG-INFO +1 -2
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/source/changelog.md +6 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/pyproject.toml +1 -3
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/__init__.py +2 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/dtypes.py +14 -4
- pydiverse_common-0.3.2/src/pydiverse/common/version.py +10 -0
- pydiverse_common-0.3.2/tests/test_version.py +8 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.gitattributes +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.github/CODEOWNERS +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.github/dependabot.yml +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.github/workflows/release.yml +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.github/workflows/tests.yml +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.github/workflows/update-lockfiles.yml +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.gitignore +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.pre-commit-config.yaml +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/.readthedocs.yaml +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/LICENSE +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/README.md +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/Makefile +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/make.bat +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/package/README.md +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/source/conf.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/source/index.md +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/source/license.md +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/docs/source/reference/api.rst +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/pixi.lock +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/pixi.toml +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/pytest.ini +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/errors/__init__.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/__init__.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/computation_tracing.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/deep_map.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/deep_merge.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/disposable.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/hashing.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/import_.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/structlog.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/tests/conftest.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/tests/dtypes/test_dtype_pandas.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/tests/dtypes/test_dtype_polars.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/tests/dtypes/test_dtype_pyarrow.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/tests/dtypes/test_dtype_sqlalchemy.py +0 -0
- {pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pydiverse-common
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.2
|
4
4
|
Summary: Common functionality shared between pydiverse libraries
|
5
5
|
Author: QuantCo, Inc.
|
6
6
|
Author-email: Martin Trautmann <windiana@users.sf.net>, Finn Rudolph <finn.rudolph@t-online.de>
|
@@ -47,7 +47,6 @@ Classifier: Programming Language :: SQL
|
|
47
47
|
Classifier: Topic :: Database
|
48
48
|
Classifier: Topic :: Scientific/Engineering
|
49
49
|
Classifier: Topic :: Software Development
|
50
|
-
Requires-Python: >=3.10
|
51
50
|
Description-Content-Type: text/markdown
|
52
51
|
|
53
52
|
# pydiverse.common
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "pydiverse-common"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.2"
|
4
4
|
description = "Common functionality shared between pydiverse libraries"
|
5
5
|
authors = [
|
6
6
|
{ name = "QuantCo, Inc." },
|
@@ -25,8 +25,6 @@ classifiers = [
|
|
25
25
|
"Topic :: Software Development",
|
26
26
|
]
|
27
27
|
|
28
|
-
requires-python = ">=3.10"
|
29
|
-
|
30
28
|
[tool.hatch.build.targets.wheel]
|
31
29
|
packages = ["src/pydiverse"]
|
32
30
|
|
@@ -70,6 +70,8 @@ class Dtype:
|
|
70
70
|
return Time()
|
71
71
|
if isinstance(sql_type, sqa.DateTime):
|
72
72
|
return Datetime()
|
73
|
+
if isinstance(sql_type, sqa.Interval):
|
74
|
+
return Duration()
|
73
75
|
if isinstance(sql_type, sqa.ARRAY):
|
74
76
|
return List(Dtype.from_sql(sql_type.item_type.from_sql))
|
75
77
|
if isinstance(sql_type, sqa.Null):
|
@@ -123,7 +125,10 @@ class Dtype:
|
|
123
125
|
return Bool()
|
124
126
|
if pd.api.types.is_datetime64_any_dtype(pandas_type):
|
125
127
|
return Datetime()
|
126
|
-
|
128
|
+
if pd.api.types.is_timedelta64_dtype(pandas_type):
|
129
|
+
return Duration()
|
130
|
+
# we don't know any decimal/time dtypes in pandas if column is not
|
131
|
+
# arrow backed
|
127
132
|
|
128
133
|
raise TypeError
|
129
134
|
|
@@ -172,6 +177,8 @@ class Dtype:
|
|
172
177
|
return Date()
|
173
178
|
if pa.types.is_time(arrow_type):
|
174
179
|
return Time()
|
180
|
+
if pa.types.is_duration(arrow_type):
|
181
|
+
return Duration()
|
175
182
|
raise TypeError
|
176
183
|
|
177
184
|
@staticmethod
|
@@ -225,6 +232,7 @@ class Dtype:
|
|
225
232
|
Date(): sqa.Date(),
|
226
233
|
Time(): sqa.Time(),
|
227
234
|
Datetime(): sqa.DateTime(),
|
235
|
+
Duration(): sqa.Interval(),
|
228
236
|
NullType(): sqa.types.NullType(),
|
229
237
|
}[self]
|
230
238
|
|
@@ -263,8 +271,9 @@ class Dtype:
|
|
263
271
|
String(): pd.StringDtype(),
|
264
272
|
Bool(): pd.BooleanDtype(),
|
265
273
|
Date(): "datetime64[s]",
|
266
|
-
# Time() not supported
|
267
274
|
Datetime(): "datetime64[us]",
|
275
|
+
Time(): "timedelta64[us]",
|
276
|
+
Duration(): "timedelta64[us]",
|
268
277
|
}[self]
|
269
278
|
|
270
279
|
def to_arrow(self):
|
@@ -289,6 +298,7 @@ class Dtype:
|
|
289
298
|
Date(): pa.date32(),
|
290
299
|
Time(): pa.time64("us"),
|
291
300
|
Datetime(): pa.timestamp("us"),
|
301
|
+
Duration(): pa.duration("us"),
|
292
302
|
}[self]
|
293
303
|
|
294
304
|
def to_polars(self: "Dtype"):
|
@@ -311,8 +321,8 @@ class Dtype:
|
|
311
321
|
String(): pl.Utf8,
|
312
322
|
Bool(): pl.Boolean,
|
313
323
|
Datetime(): pl.Datetime("us"),
|
314
|
-
Duration(): pl.Duration,
|
315
|
-
Time(): pl.Time,
|
324
|
+
Duration(): pl.Duration("us"),
|
325
|
+
Time(): pl.Time, # Polars uses nanoseconds since midnight
|
316
326
|
Date(): pl.Date,
|
317
327
|
NullType(): pl.Null,
|
318
328
|
}[self]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Copyright (c) QuantCo and pydiverse contributors 2025-2025
|
2
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
3
|
+
|
4
|
+
from importlib.metadata import PackageNotFoundError, version
|
5
|
+
|
6
|
+
try:
|
7
|
+
__version__ = version(__package__ or __name__)
|
8
|
+
except PackageNotFoundError:
|
9
|
+
# Running from a Git checkout or an editable install
|
10
|
+
__version__ = "0.0.0+dev"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pydiverse_common-0.3.0 → pydiverse_common-0.3.2}/src/pydiverse/common/util/computation_tracing.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|