Repository navigation
fix: Infer a type for Snowflake NUMBER(19,0) columns - #7132
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7132 +/- ##
==========================================
+ Coverage 51.82% 51.87% +0.04%
==========================================
Files 458 458
Lines 57749 57749
Branches 8488 8488
==========================================
+ Hits 29930 29958 +28
+ Misses 25792 25757 -35
- Partials 2027 2034 +7
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Thanks @patelchaitany. |
SnowflakeSource.get_table_column_names_and_types types integer columns with precision up to 18 from the precision and reads MAX() for columns with precision above 19. A NUMBER(19,0) column matched neither branch, so its type was returned as "None" and snowflake_type_to_feast_value_type raised KeyError: 'None' during feature inference and offline_write_batch. Read MAX() for every integer column with precision above 18. Before the MAX() lookups were batched in PR 5387, precision 19 also took that path. Signed-off-by: sohailshk <122166523+sohailshk@users.noreply.github.com>
Signed-off-by: sohailshk <122166523+sohailshk@users.noreply.github.com>
291da4e to
a54244c
Compare
What this PR does / why we need it:
SnowflakeSource.get_table_column_names_and_typestypesNUMBER(p,0)columns withp <= 18from the precision and readsMAX()to choose INT32 or INT64 for columns withp > 19. ANUMBER(19,0)column matched neither branch, so its type came back as the string"None"andsnowflake_type_to_feast_value_typeraisedKeyError: 'None'. That happens inwrite_to_offline_store(offline_write_batchbuilds the Arrow schema from every source column) and infeast applywhen features or join key types are inferred from the source.Columns with precision above 18 now all go through the
MAX()lookup, which is how precision 19 was handled before #5387 batched theMAX()queries.Adds
test_snowflake_source_integer_column_types(precision 18, 19 and 38, mocked Snowflake cursor). The two precision-19 cases fail on master with[('ID', 'None')].Which issue(s) this PR fixes:
N/A (no existing issue)
Checks
git commit -s)Testing Strategy
Misc
pytest tests/unit -k snowflake: 59 passed, 1 skipped. Not run against a Snowflake account.