flyte icon indicating copy to clipboard operation
flyte copied to clipboard

[BUG] `PanderaTransformer::to_python_value()` seems to be returning an incorrect type

Open danieldanciu opened this issue 1 year ago • 2 comments

The return type of the to_python_value of the pandera type transformer seems incorrect. Currently, the returned type is pandas.core.frame.DataFrame, but the declared return type is pandera.typing.DataFrame. I suspect this is because instantiating pandera.DataFrameSchema returns a pandas.core.frame.DataFrame, rather than what one would normally expect, namely a pandera.typing.DataFrame.

I will propose an MR to fix this shortly.

danieldanciu avatar May 15 '24 13:05 danieldanciu

Thank you for opening your first issue here! 🛠

welcome[bot] avatar May 15 '24 13:05 welcome[bot]

The issue arises because PanderaTransformer::to_python_value() returns a pandas.DataFrame instead of a pandera.typing.DataFrame. This discrepancy is due to the instantiation of pandera.DataFrameSchema, which returns a pandas.DataFrame.

Would you like more detail on how to address this issue?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @runllm to ask follow-up questions. See runllm.com for more!

runllm[bot] avatar May 15 '24 13:05 runllm[bot]

Hi @danieldanciu,

The pandera.typing.DataFrame is a generic type for pandas.DataFrame. You can refer to it here. Therefore, it should be fine for to_python_value() to return a pandas.core.frame.DataFrame type.

cc: @pingsutw

wayner0628 avatar Jul 31 '24 05:07 wayner0628