Skip to content

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

Open
luc-pimentel wants to merge 2 commits into
feast-dev:masterfrom
luc-pimentel:fix/5871-dbt-timestamp-type-warning
Open

luc-pimentel wants to merge 2 commits into
feast-dev:masterfrom
luc-pimentel:fix/5871-dbt-timestamp-type-warning

Conversation

@luc-pimentel

Copy link
Copy Markdown

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
Author

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

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 <[email protected]>
@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
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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbt integration: Add validation for timestamp field data type

1 participant