pydiverse-common 0.3.10__tar.gz → 0.3.11__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.10 → pydiverse_common-0.3.11}/PKG-INFO +1 -1
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/source/changelog.md +4 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/pyproject.toml +1 -1
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/dtypes.py +38 -7
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/tests/dtypes/test_dtype_sqlalchemy.py +2 -2
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.gitattributes +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.github/CODEOWNERS +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.github/dependabot.yml +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.github/scripts/check_deps.sh +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.github/workflows/release.yml +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.github/workflows/tests.yml +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.github/workflows/update-lockfiles.yml +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.gitignore +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.pre-commit-config.yaml +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/.readthedocs.yaml +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/LICENSE +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/README.md +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/Makefile +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/make.bat +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/package/README.md +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/source/conf.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/source/index.md +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/source/license.md +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/docs/source/reference/api.rst +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/pixi.lock +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/pixi.toml +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/pytest.ini +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/__init__.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/errors/__init__.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/testing.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/__init__.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/computation_tracing.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/deep_map.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/deep_merge.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/disposable.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/hashing.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/import_.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/util/structlog.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/src/pydiverse/common/version.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/tests/conftest.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/tests/dtypes/test_dtype_pandas.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/tests/dtypes/test_dtype_polars.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/tests/dtypes/test_dtype_pyarrow.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/tests/test_util.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/tests/test_version.py +0 -0
- {pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/typos.toml +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.11
|
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>
|
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.3.11 (2025-08-21)
|
4
|
+
- fixed __eq__, __hash__, and __repr__ for types with parameters
|
5
|
+
- import string length from sqlalchemy VARCHAR(n) type
|
6
|
+
|
3
7
|
## 0.3.10 (2025-08-21)
|
4
8
|
- implemented String with max_length argument for SQL VARCHAR(n) generation
|
5
9
|
- implemented Decimal with precision and scale arguments
|
@@ -23,6 +23,10 @@ class Dtype:
|
|
23
23
|
"""Return a string representation of this dtype."""
|
24
24
|
return self.__class__.__name__
|
25
25
|
|
26
|
+
def __str__(self):
|
27
|
+
"""Return a string representation of this dtype."""
|
28
|
+
return self.__repr__()
|
29
|
+
|
26
30
|
@classmethod
|
27
31
|
def is_int(cls):
|
28
32
|
"""Return ``True`` if this dtype is an integer type."""
|
@@ -71,7 +75,7 @@ class Dtype:
|
|
71
75
|
# otherwise.
|
72
76
|
return Float64()
|
73
77
|
if isinstance(sql_type, sa.String):
|
74
|
-
return String()
|
78
|
+
return String(sql_type.length)
|
75
79
|
if isinstance(sql_type, sa.Boolean):
|
76
80
|
return Bool()
|
77
81
|
if isinstance(sql_type, sa.Date):
|
@@ -416,6 +420,20 @@ class Decimal(Float):
|
|
416
420
|
self.precision = precision or 31
|
417
421
|
self.scale = scale or (self.precision // 3 + 1)
|
418
422
|
|
423
|
+
def __eq__(self, rhs):
|
424
|
+
return (
|
425
|
+
isinstance(rhs, self.__class__)
|
426
|
+
and self.precision == rhs.precision
|
427
|
+
and self.scale == rhs.scale
|
428
|
+
)
|
429
|
+
|
430
|
+
def __hash__(self):
|
431
|
+
return hash((self.__class__.__name__, self.precision, self.scale))
|
432
|
+
|
433
|
+
def __repr__(self):
|
434
|
+
"""Return a string representation of this dtype."""
|
435
|
+
return f"{self.__class__.__name__}({self.precision}, {self.scale})"
|
436
|
+
|
419
437
|
def to_sql(self):
|
420
438
|
import sqlalchemy as sa
|
421
439
|
|
@@ -480,6 +498,16 @@ class String(Dtype):
|
|
480
498
|
"""
|
481
499
|
self.max_length = max_length
|
482
500
|
|
501
|
+
def __eq__(self, rhs):
|
502
|
+
return isinstance(rhs, self.__class__) and self.max_length == rhs.max_length
|
503
|
+
|
504
|
+
def __hash__(self):
|
505
|
+
return hash((self.__class__.__name__, self.max_length))
|
506
|
+
|
507
|
+
def __repr__(self):
|
508
|
+
"""Return a string representation of this dtype."""
|
509
|
+
return f"{self.__class__.__name__}({self.max_length})"
|
510
|
+
|
483
511
|
def to_sql(self):
|
484
512
|
"""Convert this Dtype to a SQL type."""
|
485
513
|
import sqlalchemy as sa
|
@@ -523,10 +551,11 @@ class List(Dtype):
|
|
523
551
|
return isinstance(rhs, List) and self.inner == rhs.inner
|
524
552
|
|
525
553
|
def __hash__(self):
|
526
|
-
return hash((
|
554
|
+
return hash((self.__class__.__name__, hash(self.inner)))
|
527
555
|
|
528
556
|
def __repr__(self):
|
529
|
-
|
557
|
+
"""Return a string representation of this dtype."""
|
558
|
+
return f"{self.__class__.__name__}[{self.inner}]"
|
530
559
|
|
531
560
|
def to_sql(self):
|
532
561
|
import sqlalchemy as sa
|
@@ -556,11 +585,13 @@ class Enum(String):
|
|
556
585
|
def __eq__(self, rhs):
|
557
586
|
return isinstance(rhs, Enum) and self.categories == rhs.categories
|
558
587
|
|
559
|
-
def __repr__(self) -> str:
|
560
|
-
return f"Enum[{', '.join(repr(c) for c in self.categories)}]"
|
561
|
-
|
562
588
|
def __hash__(self):
|
563
|
-
return hash(tuple(self.categories))
|
589
|
+
return hash((self.__class__.__name__, tuple(self.categories)))
|
590
|
+
|
591
|
+
def __repr__(self) -> str:
|
592
|
+
return (
|
593
|
+
f"{self.__class__.__name__}[{', '.join(repr(c) for c in self.categories)}]"
|
594
|
+
)
|
564
595
|
|
565
596
|
def to_polars(self):
|
566
597
|
import polars as pl
|
@@ -111,7 +111,7 @@ def test_all_types(type_):
|
|
111
111
|
if type_ is pdc.List:
|
112
112
|
type_obj = type_(pdc.Int64())
|
113
113
|
elif type_ is pdc.Enum:
|
114
|
-
type_obj = type_("a", "
|
114
|
+
type_obj = type_("a", "bbb", "cc")
|
115
115
|
else:
|
116
116
|
type_obj = type_()
|
117
117
|
dst_type = type_obj.to_sql()
|
@@ -129,6 +129,6 @@ def test_all_types(type_):
|
|
129
129
|
Float: Float64(),
|
130
130
|
Int: Int64(),
|
131
131
|
# there is no Enum
|
132
|
-
Enum: String(),
|
132
|
+
Enum: String(3),
|
133
133
|
}
|
134
134
|
assert back_type == acceptance_map.get(type_, type_obj)
|
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
|
File without changes
|
File without changes
|
File without changes
|
{pydiverse_common-0.3.10 → pydiverse_common-0.3.11}/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
|
File without changes
|
File without changes
|