fix: suppress pyarrow nullability warning for primary keys#4132
Open
Sam-Razavi wants to merge 1 commit into
Open
fix: suppress pyarrow nullability warning for primary keys#4132Sam-Razavi wants to merge 1 commit into
Sam-Razavi wants to merge 1 commit into
Conversation
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
Fixes #3581.
When
remove_nullability_adapteris used with the PyArrow backend, dlt correctly keeps reflected primary-key columns asnullable=False. PyArrow does not retain primary-key metadata and reports those fields as nullable, which causes a misleading Arrow-schema conflict warning.This PR suppresses only that expected mismatch when:
nullable=Falsenullable=TrueSchema merging remains unchanged, and primary-key columns remain non-nullable.
Related Issues
Additional Context
Added a SQL + PyArrow regression test using
remove_nullability_adapterthat verifies the reflectedidcolumn remains a non-nullable primary key and that no Arrow-schema merge message is emitted.Local checks completed:
test_remove_nullabilitypassedflake8for changed files passedgit diff --checkpassedTargeted
mypydid not complete locally within five minutes and produced no diagnostics, so CI should verify that check.