patito 0.8.4__py3-none-any.whl → 0.8.6__py3-none-any.whl
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/polars.py +3 -4
- patito/pydantic.py +2 -2
- {patito-0.8.4.dist-info → patito-0.8.6.dist-info}/METADATA +2 -2
- {patito-0.8.4.dist-info → patito-0.8.6.dist-info}/RECORD +6 -6
- {patito-0.8.4.dist-info → patito-0.8.6.dist-info}/WHEEL +1 -1
- {patito-0.8.4.dist-info → patito-0.8.6.dist-info}/licenses/LICENSE +0 -0
patito/polars.py
CHANGED
|
@@ -443,7 +443,7 @@ class DataFrame(pl.DataFrame, Generic[ModelType]):
|
|
|
443
443
|
>>> casted_classes.validate()
|
|
444
444
|
|
|
445
445
|
"""
|
|
446
|
-
return model.DataFrame(self._df)
|
|
446
|
+
return model.DataFrame._from_pydf(self._df)
|
|
447
447
|
|
|
448
448
|
def unalias(self: DF) -> DF:
|
|
449
449
|
"""Un-aliases column names using information from pydantic validation_alias.
|
|
@@ -537,9 +537,8 @@ class DataFrame(pl.DataFrame, Generic[ModelType]):
|
|
|
537
537
|
|
|
538
538
|
"""
|
|
539
539
|
if columns is not None:
|
|
540
|
-
#
|
|
541
|
-
|
|
542
|
-
return self._from_pydf(pl.DataFrame(self._df).drop(columns)._df)
|
|
540
|
+
# Use super() to call polars DataFrame drop method directly
|
|
541
|
+
return self._from_pydf(super().drop(columns)._df)
|
|
543
542
|
else:
|
|
544
543
|
return self.drop(list(set(self.columns) - set(self.model.columns)))
|
|
545
544
|
|
patito/pydantic.py
CHANGED
|
@@ -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(
|
|
@@ -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
|
|
@@ -10,7 +10,7 @@ License-Expression: MIT
|
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Keywords: dataframe,validation
|
|
12
12
|
Requires-Python: >=3.9
|
|
13
|
-
Requires-Dist: polars>=1.
|
|
13
|
+
Requires-Dist: polars>=1.32.0
|
|
14
14
|
Requires-Dist: pydantic>=2.7.0
|
|
15
15
|
Requires-Dist: typing-extensions
|
|
16
16
|
Provides-Extra: caching
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
patito/__init__.py,sha256=4qD13kfoa85_kyTCChm3xQcKKzIy3G8AZQp8T_bjcmo,844
|
|
2
2
|
patito/_docs.py,sha256=9mfttyylWpqaOZv8xfDMEwCHHaY7GQwfyI7CDg7tWe8,162
|
|
3
3
|
patito/exceptions.py,sha256=rv0AUVqxxnP00wmjgaqOPz0Ht6er-SjdeunHAul9brs,6034
|
|
4
|
-
patito/polars.py,sha256=
|
|
5
|
-
patito/pydantic.py,sha256=
|
|
4
|
+
patito/polars.py,sha256=1AYcsJRItAnMt5TN5NI-w4plMVauGhf_HFl7rhqgb7E,38743
|
|
5
|
+
patito/pydantic.py,sha256=KCKVkTwZ_qraQEfx-4RuTHMCGHwlLexVbZ5SUFuvyBU,49474
|
|
6
6
|
patito/validators.py,sha256=Ne6mj8js3RDAcgw6p558wdic3VA7Kbu6AgDIq0X9hzg,18603
|
|
7
7
|
patito/_pydantic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
patito/_pydantic/column_info.py,sha256=u6sZ2212VppgBmcISWzGNY6ZfBiNFJtlwj1lDXDFL4c,5366
|
|
@@ -11,7 +11,7 @@ patito/_pydantic/schema.py,sha256=BI2qAhNM29NxS366K9eRi8thgE2P3t8GFt1HzwlWxos,36
|
|
|
11
11
|
patito/_pydantic/dtypes/__init__.py,sha256=2vTvL4N4yMN0cbv2CSoa1OFwCswx6FhuQdsYhMaz_dU,578
|
|
12
12
|
patito/_pydantic/dtypes/dtypes.py,sha256=KETa3U01sQEub6sCckCHfNz781LOlvziRwxADkyUQyA,9842
|
|
13
13
|
patito/_pydantic/dtypes/utils.py,sha256=wuJv-cYDftaN1OLCGM4sPlEMsIj7rZLlaHKezBa474U,6659
|
|
14
|
-
patito-0.8.
|
|
15
|
-
patito-0.8.
|
|
16
|
-
patito-0.8.
|
|
17
|
-
patito-0.8.
|
|
14
|
+
patito-0.8.6.dist-info/METADATA,sha256=-EDAjFSZI0ou2J_hE_skA32LVNgcSQipdFvytasEe18,13439
|
|
15
|
+
patito-0.8.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
16
|
+
patito-0.8.6.dist-info/licenses/LICENSE,sha256=3bc4YyuF0e5nd59E3CsR8QM1Ua7pqKfC9DD1LVBVMs4,1139
|
|
17
|
+
patito-0.8.6.dist-info/RECORD,,
|
|
File without changes
|