Skip to content

Pydantic arbitrary_types_allowed supported as pa.binary()#26

Open
ZaraGi wants to merge 1 commit into
simw:mainfrom
g-loci:main
Open

Pydantic arbitrary_types_allowed supported as pa.binary()#26
ZaraGi wants to merge 1 commit into
simw:mainfrom
g-loci:main

Conversation

@ZaraGi

@ZaraGi ZaraGi commented Apr 10, 2025

Copy link
Copy Markdown

Resolves #25

@dalberti

Copy link
Copy Markdown

good news?

@simw

simw commented May 10, 2025

Copy link
Copy Markdown
Owner

Thanks for the submission (and sorry for the delay)!

At the moment, in the PR teh code doesn't look at the allow_arbitrary_types flag, and defaults to allowing them. So there might be some regular types that pydantic allows (ie without the flag) for which pa.binary might be unexpected behavior? I think that it would be better to check for the config flag, and then convert unknowns to pa.binary.

Let me know if this would do something unexpected or not be as useful. I'll look at adding the check on the config.

@simw

simw commented May 10, 2025

Copy link
Copy Markdown
Owner

I've added some extra code on top of your commit to observe the settings - looking at model_config for arbitrary_types_allowed and at the arbitrary_types_allowed supplied to get_pyarrow_schema. It's in #29 . Let me know what you think.

If that looks ok, I'll merge the other PR and decline this one, and then resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support arbitrary types

3 participants