fix(fabric): widen tinyint integer precision to smallint - #4307
Open
sdebruyn wants to merge 1 commit into
Open
Conversation
anuunchin
self-requested a review
August 7, 2026 13:30
sdebruyn
force-pushed
the
fix/4306-fabric-tinyint-smallint
branch
from
August 13, 2026 15:38
4fbc676 to
c563cc9
Compare
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.
Fixes #4306
Summary
to_db_integer_typeinFabricTypeMapperso abigintcolumn withprecision <= 8maps tosmallintinstead oftinyintRoot cause
Fabric Warehouse has no
tinyint;smallintis its narrowest integer type.sql_databasereflects a SQL ServerTINYINTas dlt typebigintwithprecision=8, andMsSqlTypeMapper.to_db_integer_typemaps that totinyint.FabricTypeMapperinherits that throughSynapseTypeMapperand previously overrode only the datetime and string mappings, soCREATE TABLEfailed with aDatabaseTerminalException. Being terminal, the load was not retried and every subsequent run failed on the same table.Widening is safe:
TINYINTvalues (0-255) all fit insmallint. Nothing changes formssqlorsynapse, wheretinyintis valid.Test plan
test_fabric_type_mapper_integer_precision, parametrized over no precision, 8, 16, 32 and 64, assertingbigint,smallint,smallint,int,bigint. It also asserts the input column is left untouched.develbefore the change that precision 8 yieldstinyint, so the test is a real regression guard.tests/load/fabric: 20 passed, 1 skipped (the table builder module skips without an ODBC driver).impl/**/factory.py) and black all clean.