Skip to content

Commit

Permalink
Remove valid_dtypes docstring example since it is giving a different …
Browse files Browse the repository at this point in the history
…sort sometimes on py39
  • Loading branch information
thomasaarholt committed Mar 3, 2024
1 parent 9eff95b commit 03bff6b
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions src/patito/pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,41 +182,15 @@ def valid_dtypes(
The first item of each list is the default dtype chosen by Patito.
Returns:
Returns
-------
A dictionary mapping each column string name to a list of valid dtypes.
Raises:
Raises
------
NotImplementedError: If one or more model fields are annotated with types
not compatible with polars.
Example:
-------
>>> from pprint import pprint
>>> import patito as pt
>>> class MyModel(pt.Model):
... bool_column: bool
... str_column: str
... int_column: int
... float_column: float
...
>>> pprint(MyModel.valid_dtypes)
{'bool_column': DataTypeGroup({Boolean}),
'float_column': DataTypeGroup({Float64, Float32}),
'int_column': DataTypeGroup({Int8,
Int16,
Int32,
Int64,
UInt8,
UInt16,
UInt32,
UInt64,
Float32,
Float64}),
'str_column': DataTypeGroup({String})}
"""
return valid_dtypes_for_model(cls)

Expand Down

0 comments on commit 03bff6b

Please sign in to comment.