Skip to content

feat: Warn when the dbt import timestamp field is not a timestamp type - #7038

Merged
ntkathole merged 2 commits into
feast-dev:masterfrom
luc-pimentel:fix/5871-dbt-timestamp-type-warning
Nov 21, 2026
Merged

ntkathole merged 2 commits into
feast-dev:masterfrom
luc-pimentel:fix/5871-dbt-timestamp-type-warning

Conversation

@luc-pimentel

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

feast dbt import checked only that the timestamp column exists. A column declared STRING or INT64 imported silently, and the resulting FeatureView fails at the first get_historical_features call with AttributeError: 'str' object has no attribute 'tzinfo'.

The import now checks the column's dbt type through the existing dbt-to-Feast type mapping and prints one warning per model when it does not map to a timestamp type. The model is still imported. Columns with no data_type in schema.yml reach the CLI as STRING and get the same warning. Spellings the mapping does not know yet, such as Postgres timestamp with time zone or DATETIME2, also warn; extending the mapping is a separate change. The troubleshooting section of the dbt how-to documents the new message.

Which issue(s) this PR fixes:

Fixes #5871

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

New CLI tests build a manifest and run feast dbt import --dry-run: the warning appears for STRING, INT64 and an undeclared type, and does not appear for TIMESTAMP or TIMESTAMP_NTZ(9); warned models still produce their DataSource and FeatureView. All 43 dbt unit tests pass. Scoped Ruff, formatting and mypy checks pass. The before/after reproduction on Feast 0.67.0 and master passes its controls.

Misc

AI-assisted implementation and tests.

@luc-pimentel

Copy link
Copy Markdown
Contributor Author

Could someone please take a look at this PR when you have a chance? Thanks!

@luc-pimentel
luc-pimentel force-pushed the fix/5871-dbt-timestamp-type-warning branch from 47b02a4 to 46b60e0 Compare November 10, 2026 13:22
@luc-pimentel

Copy link
Copy Markdown
Contributor Author

Rebased onto master to resolve the conflict with #7067. The conflicts were in the import block and the troubleshooting section; the check itself is unchanged. All 56 dbt unit tests pass.

@devin-ai-integration devin-ai-integration Bot 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.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@codecov-commenter

codecov-commenter commented Nov 20, 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 53.67%. Comparing base (01925b0) to head (57bb92e).
❗ 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    #7038   +/-   ##
=======================================
  Coverage   53.66%   53.67%           
=======================================
  Files         462      462           
  Lines       58546    58549    +3     
  Branches     8633     8634    +1     
=======================================
+ Hits        31421    31424    +3     
  Misses      24988    24988           
  Partials     2137     2137           
Flag Coverage Δ
go-feature-server 30.96% <ø> (ø)
python-unit 55.25% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/cli/dbt_import.py 63.03% <100.00%> (+0.68%) ⬆️

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 01925b0...57bb92e. 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.

Signed-off-by: luc-pimentel <154371376+luc-pimentel@users.noreply.github.com>
The import command only checked that the timestamp column exists, so a column declared STRING or INT64 produced a FeatureView whose timestamp_field cannot anchor point-in-time retrieval. Check the column's dbt type with the existing dbt-to-Feast mapping and print a warning when it does not map to a timestamp type. The model is still imported.

Signed-off-by: luc-pimentel <154371376+luc-pimentel@users.noreply.github.com>
@ntkathole
ntkathole force-pushed the fix/5871-dbt-timestamp-type-warning branch from 46b60e0 to 57bb92e Compare November 21, 2026 12:58
@ntkathole
ntkathole merged commit 7e7208b into feast-dev:master Nov 21, 2026
25 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.

dbt integration: Add validation for timestamp field data type

4 participants