Open CallumMcMahon opened 5 days ago
Thank you for raising the issue!
Yes, previously this library completely ignored the alias settings. Looking at the pydantic docs, it looks like Model.model_dump() can take a by_alias parameter. By default, model_dump will ignore the alias, but when by_alias is set to True then it will use the (serialization) alias. (https://docs.pydantic.dev/latest/concepts/alias/)
I've updated the code in PR #19 . (Let me know if you see any issues in that). I'm also going to have a quick look at whether the code just works in python 3.13, and then will make a release with the new functionality.
Thanks again!
First of all thanks for making such a useful tool!
For context I started with a json-schema file. I then used datamodel_code_generator to create a pydantic model.
The schema itself has a field named
yield
, which that tool correctly converts toyield_: <type> = Field(alias="yield")
.However when running this tool to convert the resulting model into a pyarrow schema, the final pyarrow schema field is called
yield_
. The expected output would be a pyarrow field calledyield
based on the alias name.Thanks