You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the issue, the get_table method in calculate_freshness_from_metadata creates a temp table containing all matched tables and returns its creation time as modified instead of actual latest modified time we'd like to retrieve.
Therefore, we should raise an error or implement an alternative way for tables containing a wildcard in their name.
If I specify loaded_at_field for the source with wildcard, the source freshness command can successfully fetch the latest timestamp from all matched tables. Therefore, it is natural that users assume without loaded_at_field the source freshness command also works correctly. However, it doesn't now.
Is this a new bug in dbt-bigquery?
Current Behavior
I define a table with a wildcard as a source and then run a freshness test without loaded_at_field to retrieve freshness from metadata.
Even if the table was created a few days ago,
max_loaded_at_time_ago_in_s
is less than a second.source.json looks like this:
Expected Behavior
max_loaded_at
should be the table creation time, not the current timestamp.Steps To Reproduce
loaded_at_field
to run metadata source freshness.Relevant log output
No response
Environment
Additional Context
According to the issue, the get_table method in calculate_freshness_from_metadata creates a temp table containing all matched tables and returns its creation time as
modified
instead of actual latest modified time we'd like to retrieve.Therefore, we should raise an error or implement an alternative way for tables containing a wildcard in their name.
https://github.com/dbt-labs/dbt-bigquery/blob/v1.8.2/dbt/adapters/bigquery/impl.py#L726-L744
The text was updated successfully, but these errors were encountered: