Skip to content

fix: Infer a type for Snowflake NUMBER(19,0) columns - #7132

Merged
ntkathole merged 2 commits into
feast-dev:masterfrom
sohailshk:fix/snowflake-number19-type
Nov 12, 2026
Merged

ntkathole merged 2 commits into
feast-dev:masterfrom
sohailshk:fix/snowflake-number19-type

Conversation

@sohailshk

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

SnowflakeSource.get_table_column_names_and_types types NUMBER(p,0) columns with p <= 18 from the precision and reads MAX() to choose INT32 or INT64 for columns with p > 19. A NUMBER(19,0) column matched neither branch, so its type came back as the string "None" and snowflake_type_to_feast_value_type raised KeyError: 'None'. That happens in write_to_offline_store (offline_write_batch builds the Arrow schema from every source column) and in feast apply when 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 the MAX() 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

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Misc

pytest tests/unit -k snowflake: 59 passed, 1 skipped. Not run against a Snowflake account.

@sohailshk
sohailshk requested a review from a team as a code owner November 11, 2026 07:52
@codecov-commenter

codecov-commenter commented Nov 11, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.87%. Comparing base (5bf4b4c) to head (a54244c).
⚠️ Report is 3 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 53.38% <ø> (+0.05%) ⬆️
Files with missing lines Coverage Δ
...hon/feast/infra/offline_stores/snowflake_source.py 75.81% <ø> (+18.30%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bf4b4c...a54244c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@patelchaitany patelchaitany left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sohailshk

Copy link
Copy Markdown
Contributor Author

Thanks @patelchaitany. lint-python was red because of the detect-secrets hook: the new tests moved the existing test password in test_snowflake.py down by two lines, so .secrets.baseline needed its line number updated (24 -> 26). Pushed that in 291da4e.

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>
@ntkathole
ntkathole force-pushed the fix/snowflake-number19-type branch from 291da4e to a54244c Compare November 12, 2026 03:32
@ntkathole
ntkathole merged commit d3d812c into feast-dev:master Nov 12, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants