Time-agnostic DateTime with pandera-native polars datatype using DataFrameModel not working #1637
Closed
2 of 3 tasks
Labels
bug
Something isn't working
The use of
dtype_kwargs
for thepandera.engines.polars_engine.DateTime
dtype as demonstrated in the documentation examples does not seem to work when using with aDataFrameModel
.I tried with all 3 variations of the
DataFrameModel
, as well as using aDataFrameSchema
and only the latter seems to work as expected:Code Sample:
Output:
Expected behaviour
I expect the validation to fail on schemas that don't provide
time_zone_agnostic=True
(which is the case), and for it to pass validation when settingtime_zone_agnostic=True
.Actual behaviour
The use of
pa.Field
fails with'Datetime' object is not callable
and the use ofAnnotated
fails withAnnotation 'DateTime' requires all positional arguments ['time_zone_agnostic', 'time_zone', 'time_unit']
.For the case of
pa.Field
, it looks like an instance ofpl.Datetime
gets returned byengine_dtype = pe.Engine.dtype(annotation.raw_annotation)
in_build_columns()
ofclass DataFrameModel
, and then called again withdtype(**self.dtype_kwargs)
in_get_schema_properties()
ofclass FieldInfo
which throws the error.Desktop
The text was updated successfully, but these errors were encountered: