Open jjfantini opened 1 year ago
@jjfantini I agree that this should be added, but in the meantime, wouldn't an instantiation using pyarrow
be better because the data is already stored as Arrow arrays on the backend?
StockBaseModel.DataFrame._from_arrow(df.to_arrow())
Yup, that is what I currently do, although I would suggest df.to_dict()
. It is a smidge faster.
Although I have stopped using patito since my project requires Pydantic v2. I have published a package humblpatito
that is compatible with Pydantic V2, but don't have time right now to flesh out all the edge cases. Plus, I want to use AliasChoices
in V2
Right now, you can only create a model-aware DataFrame from either a dict representation or from pandas. It would be great for workflow to be able to do this with polars objects.