Describe the bugpandera.api.dataframe.model.DataFrameModel.get_metadata (source) should return dict (or even a TypedDict) instead of Optional[dict] since the current implementation never returns None.
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of pandera.
[x] (optional) I have confirmed this bug exists on the main branch of pandera.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
import pandera as pa
class Foo(pa.DataFrameModel):
x: int
x = Foo.get_metadata()[str(Foo)] # Value of type "Optional[dict[Any, Any]]" is not indexable
Expected behavior
Should not return an error.
Desktop (please complete the following information):
Describe the bug
pandera.api.dataframe.model.DataFrameModel.get_metadata
(source) should returndict
(or even aTypedDict
) instead ofOptional[dict]
since the current implementation never returnsNone
.Note: 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
Should not return an error.
Desktop (please complete the following information):
Screenshots
N/A
Additional context
N/A