[Bug] metadata source freshness does not work as intended if table name contains wildcard. #1363
Open
2 tasks done
Labels
bug
Something isn't working
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: