Open mangecoeur opened 1 year ago
Hi @mangecoeur, relabelling this as an enhancement, as FastAPI support is only currently for pandera.typing.pandas.DataFrame
(should probably document this if it isn't already)
Basically the GeoDataFrame
generic class needs a __get_validators__ method where currently it's just a bare generic class: https://github.com/unionai-oss/pandera/blob/main/pandera/typing/geopandas.py#L34
Probably won't get to this for a few months, but would welcome a PR from you or the community!
I picked this up and will submit PR soon
Describe the bug A clear and concise description of what the bug is.
Code Sample, a copy-pastable example
Produces the error:
Fields of type "<class 'pandera.typing.geopandas.GeoDataFrame'>" are not supported.
Irrespective of whether to_format is defined.
Expected behavior
Similar to DataFrame can be used in annotation, would like to be able to use a GeoDataFrame. Conversion of the GeoDataFrame would be controlled by to_format (e.g. to produce a GeoJson). I assume that since FastAPI doesn't support DataFrame by default either somewhere the pandera types are registered with FastAPI.
Desktop (please complete the following information):