fix(polars): support pl.Object conversion to dt.Unknown in PolarsType.to_ibis - #12086
Open
AhmadBilalDSA wants to merge 1 commit into
Open
fix(polars): support pl.Object conversion to dt.Unknown in PolarsType.to_ibis#12086AhmadBilalDSA wants to merge 1 commit into
AhmadBilalDSA wants to merge 1 commit into
Conversation
deepyaman
requested changes
Aug 25, 2026
deepyaman
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR. Without an issue or some more description, as well as lacking tests, it's not clear what the motivation is. (Sure, I can infer it's somewhere where you have data that maps to pl.Object, but where did you actually experience this bug, and how do I know that's fixed, without investigating myself.)
Comment on lines
+180
to
+181
| def test_object_type_to_ibis(): | ||
| assert PolarsType.to_ibis(pl.Object) == dt.Unknown() |
Collaborator
There was a problem hiding this comment.
This is insufficient; at the very least, I think need something akin to https://github.com/ibis-project/ibis/blob/12.0.0/ibis/backends/postgres/tests/test_client.py#L207-L210 to test the actual use case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When inferring or converting schemas from Polars tables containing Python object columns (
pl.Object),PolarsType.to_ibispreviously raised aKeyError: Objectdue topl.Objectmissing from the inverse lookup registry.This PR adds explicit handling for
pl.Objectto map cleanly todt.Unknown(nullable=nullable), matching expected schema behavior when encountering uncoerced Python object columns.Checklist
pl.Objecthandling inibis/formats/polars.pytest_object_type_to_ibisinibis/formats/tests/test_polars.pyruff checkandruff formatpytest ibis/formats/tests/test_polars.py(41/41 passing)