Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add accepted_field_type for Unions with Missing #96

Merged
merged 1 commit into from
Jun 13, 2023
Merged

Conversation

ararslan
Copy link
Member

PR #89 fixed compatibility with Arrow v2.6 except when the schema field's declared type is e.g. Union{Vector{T},Missing} and what's passed for validation is some AbstractVector. This adds a method to accepted_field_type that recurses on the non-Missing type in a Union with Missing. Note that this also necessitated adding an explicit accepted_field_type method for Any to avoid infinite recursion with the fallback definition, since (Union{T,Missing} where {T}) == Any.

PR #89 fixed compatibility with Arrow v2.6 except when the schema
field's declared type is e.g. `Union{Vector{T},Missing}` and what's
passed for validation is some `AbstractVector`. This adds a method to
`accepted_field_type` that recurses on the non-`Missing` type in a
`Union` with `Missing`. Note that this also necessitated adding an
explicit `accepted_field_type` method for `Any` to avoid infinite
recursion with the fallback definition, since `(Union{T,Missing} where
{T}) == Any`.
Copy link
Member

@jrevels jrevels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref #63

@ararslan ararslan merged commit 3e86ec0 into main Jun 13, 2023
5 checks passed
@ararslan ararslan deleted the aa/union-missing branch June 13, 2023 02:08
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.

2 participants