patito 0.8.5__tar.gz → 0.8.6__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.
- {patito-0.8.5 → patito-0.8.6}/PKG-INFO +1 -1
- {patito-0.8.5 → patito-0.8.6}/pyproject.toml +12 -13
- {patito-0.8.5 → patito-0.8.6}/src/patito/pydantic.py +2 -2
- {patito-0.8.5 → patito-0.8.6}/tests/test_validators.py +7 -1
- {patito-0.8.5 → patito-0.8.6}/uv.lock +1 -1
- {patito-0.8.5 → patito-0.8.6}/.github/workflows/ci.yml +0 -0
- {patito-0.8.5 → patito-0.8.6}/.github/workflows/coverage.yml +0 -0
- {patito-0.8.5 → patito-0.8.6}/.github/workflows/pre-commit.yml +0 -0
- {patito-0.8.5 → patito-0.8.6}/.github/workflows/release.yml +0 -0
- {patito-0.8.5 → patito-0.8.6}/.gitignore +0 -0
- {patito-0.8.5 → patito-0.8.6}/.pre-commit-config.yaml +0 -0
- {patito-0.8.5 → patito-0.8.6}/.readthedocs.yaml +0 -0
- {patito-0.8.5 → patito-0.8.6}/.tool-versions +0 -0
- {patito-0.8.5 → patito-0.8.6}/LICENSE +0 -0
- {patito-0.8.5 → patito-0.8.6}/README.md +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/_static/css/custom.css +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/index.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/cast.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/derive.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/drop.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/fill_null.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/get.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/index.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/iter_models.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/read_csv.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/set_model.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/DataFrame/validate.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Field/index.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/DataFrame.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/LazyFrame.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/columns.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/defaults.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/drop.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/dtypes.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/example.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/example_value.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/examples.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/from_row.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/index.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/iter_models.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/join.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/non_nullable_columns.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/nullable_columns.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/pandas_examples.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/prefix.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/rename.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/select.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/suffix.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/unique_columns.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/valid_dtypes.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/validate.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/api/patito/Model/with_fields.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/conf.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/fix_header_underline.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/index.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/license.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/tutorial/dataframe-validation.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/docs/tutorial/index.rst +0 -0
- {patito-0.8.5 → patito-0.8.6}/noxfile.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/__init__.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_docs.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_pydantic/__init__.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_pydantic/column_info.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_pydantic/dtypes/__init__.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_pydantic/dtypes/dtypes.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_pydantic/dtypes/utils.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_pydantic/repr.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/_pydantic/schema.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/exceptions.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/polars.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/src/patito/validators.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/tests/__init__.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/tests/examples.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/tests/test_dtypes.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/tests/test_dummy_data.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/tests/test_model.py +0 -0
- {patito-0.8.5 → patito-0.8.6}/tests/test_polars.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: patito
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.6
|
|
4
4
|
Summary: A dataframe modelling library built on top of polars and pydantic.
|
|
5
5
|
Project-URL: Homepage, https://github.com/JakobGM/patito
|
|
6
6
|
Project-URL: Repository, https://github.com/JakobGM/patito
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "patito"
|
|
3
|
-
version = "0.8.
|
|
3
|
+
version = "0.8.6"
|
|
4
4
|
description = "A dataframe modelling library built on top of polars and pydantic."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Jakob Gerhard Martinussen", email = "jakobgm@gmail.com" },
|
|
@@ -30,25 +30,24 @@ Documentation = "https://patito.readthedocs.io"
|
|
|
30
30
|
|
|
31
31
|
[dependency-groups]
|
|
32
32
|
dev = [
|
|
33
|
-
"
|
|
33
|
+
"Sphinx<7",
|
|
34
|
+
"blackdoc",
|
|
35
|
+
"codecov>=2.1.12,<3",
|
|
36
|
+
"coverage[toml]",
|
|
37
|
+
"ipykernel>=6.29.4,<7",
|
|
38
|
+
"mypy>=0.950",
|
|
34
39
|
"nox",
|
|
35
40
|
"nox-uv>=0.6.0",
|
|
36
|
-
"
|
|
41
|
+
"pandas-stubs>=1.2.0",
|
|
37
42
|
"pre-commit>=3.8.0,<4",
|
|
38
|
-
"coverage[toml]",
|
|
39
43
|
"pyright>=1.1.239",
|
|
40
|
-
"pytest>=7.1.2",
|
|
41
44
|
"pytest-cov>=3.0.0",
|
|
42
45
|
"pytest-watcher>=0.2.3 ; python_version >= '3.9' and python_version < '4.0'",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
46
|
+
"pytest>=7.1.2",
|
|
47
|
+
"ruff>=0.2.1",
|
|
45
48
|
"types-setuptools>=57.4.14",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"blackdoc",
|
|
49
|
-
"ipykernel>=6.29.4,<7",
|
|
50
|
-
"Sphinx<7",
|
|
51
|
-
"nox-uv>=0.6.0",
|
|
49
|
+
"uv",
|
|
50
|
+
"xdoctest>=1.0.0",
|
|
52
51
|
]
|
|
53
52
|
|
|
54
53
|
docs = [
|
|
@@ -466,7 +466,7 @@ class Model(BaseModel, metaclass=ModelMetaclass):
|
|
|
466
466
|
Rows with invalid values: {'oven'}. (type=value_error.rowvalue)
|
|
467
467
|
|
|
468
468
|
"""
|
|
469
|
-
validate(
|
|
469
|
+
validated_df = validate(
|
|
470
470
|
dataframe=dataframe,
|
|
471
471
|
schema=cls,
|
|
472
472
|
columns=columns,
|
|
@@ -474,7 +474,7 @@ class Model(BaseModel, metaclass=ModelMetaclass):
|
|
|
474
474
|
allow_superfluous_columns=allow_superfluous_columns,
|
|
475
475
|
drop_superfluous_columns=drop_superfluous_columns,
|
|
476
476
|
)
|
|
477
|
-
return cls.DataFrame(
|
|
477
|
+
return cls.DataFrame(validated_df)
|
|
478
478
|
|
|
479
479
|
@classmethod
|
|
480
480
|
def iter_models(
|
|
@@ -270,7 +270,13 @@ def test_drop_superfluous_columns() -> None:
|
|
|
270
270
|
SingleColumnModel,
|
|
271
271
|
drop_superfluous_columns=True,
|
|
272
272
|
)
|
|
273
|
-
|
|
273
|
+
expected_columns = ["column_1"]
|
|
274
|
+
assert result.columns == expected_columns
|
|
275
|
+
|
|
276
|
+
result_from_cls_method = SingleColumnModel.validate(
|
|
277
|
+
test_df, drop_superfluous_columns=True
|
|
278
|
+
)
|
|
279
|
+
assert result_from_cls_method.columns == expected_columns
|
|
274
280
|
|
|
275
281
|
|
|
276
282
|
def test_validate_non_nullable_columns() -> None:
|
|
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
|
|
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
|
|
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
|