We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list[str]
Describe the bug A fix for #1342 , might have broken support for list[str] dtype
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
import pandas as pd import pandera as pa from pandera.typing import DataFrame, Index, Series class DFModel(pa.DataFrameModel): idx: Index[int] col_float: Series[float] = pa.Field(coerce=True, nullable=True) col_str: Series[str] = pa.Field(coerce=True, nullable=True) col_lst: Series[list[str]] = pa.Field(coerce=True, nullable=True) df = ( pd.DataFrame( [ {"idx": 1, "col_float": 1.0, "col_str": "one", "col_lst": ["one"]}, {"idx": 2, "col_float": None, "col_str": None, "col_lst": []}, {"idx": 3, "col_float": None, "col_str": None, "col_lst": None}, ] ) .convert_dtypes(infer_objects=False, dtype_backend="numpy_nullable") .pipe(DataFrame[DFModel]) ) ... python3.10/site-packages/pandas/core/dtypes/common.py:1636, in pandas_dtype(dtype) 1631 with warnings.catch_warnings(): 1632 # GH#51523 - Series.astype(np.integer) doesn't show 1633 # numpy deprecation warning of np.integer 1634 # Hence enabling DeprecationWarning 1635 warnings.simplefilter("always", DeprecationWarning) -> 1636 npdtype = np.dtype(dtype) 1637 except SyntaxError as err: 1638 # np.dtype uses `eval` which can raise SyntaxError 1639 raise TypeError(f"data type '{dtype}' not understood") from err TypeError: Cannot interpret 'list[str]' as a data type
A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
I encountered this error as well when creating the PR, have you tried this on the latest main branch yet? Which version are you using?
main
Sorry, something went wrong.
Ah, i assumed the version released yesterday included this fix.
I just tested this. It works fine on main, soz!
No branches or pull requests
Describe the bug
A fix for #1342 , might have broken support for
list[str]
dtypeNote: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: