Fix nullable type handling for column types#237
Merged
Conversation
added 5 commits
March 25, 2026 18:16
Previously only date/datetime types were wrapped in Nullable() when the JSON schema included "null". This caused nullable boolean (and other) columns from source databases to lose their NULL values — NULLs were silently converted to default values (false for bools, 0 for ints, etc). Now checks the JSON schema for "null" in the type array and wraps any non-primary-key column in Nullable() accordingly.
xuekat
approved these changes
Mar 26, 2026
nrdyava
approved these changes
Mar 26, 2026
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.
Summary
Nullable()when the source schema allowed nullstypearray for"null"and wraps any non-primary-key column inNullable()accordinglyRoot cause
The
to_sql_type()method inconnectors.pyhad explicitNullable()wrapping forDATE,TIMESTAMP,TIME, andDATETIMEtypes, but no handling forBOOLEAN,INTEGER,FLOAT,VARCHAR, etc. The Singer SDK JSON schema represents nullable fields as{"type": ["boolean", "null"]}but this null indicator was ignored for non-date types.Impact
Affects any source table with nullable boolean/integer/float/string columns. Confirmed on Outdoorsy's
rentalstable: 18 boolean columns all created asBoolinstead ofNullable(Bool), with all source NULLs converted tofalse.Test plan
Nullable(Bool)in Clickhouse