Flora Schneider
01/05/2024, 10:57 AMvolume_anomalies test on source data where the date column i want to use for the timestamp_column parameter is a string with format like 20240105. So i need to parse it to an actual timestamp with parse_timestamp('%Y%m%d', event_date). It worked with timestamp_column: "parse_timestamp('%Y%m%d', event_date)" until upgrading to the latest elementary version, now this workaround is throwing an error (because the timestamp_column is also used as an alias in the query that tests creates and aliases can’t contain functions).
Is there another way to parse the timestamp? Since it’s source data i’m testing there’s no way to transform the timestamp in the table itself. Thanks in advance!Ofek Weiss
01/08/2024, 2:52 PMview model on top of the source (which parses the timestamp and names it) and running the volume_anomalies test on it insteadFlora Schneider
01/08/2024, 3:15 PMtimestamp_column is used as an alias in the SQL which was just added recently. In my case it results in this line in the by the macro generated query:
cast(parse_timestamp('%Y%m%d', event_date) as TIMESTAMP) as parse_timestamp('%Y%m%d', event_date)
… which ofc fails due to having a function in the alias.
I moved the tests from source to base tables as a workaround and it’s fine. But it was a nice hack to be able to cast a string to an actual timestamp in the test configs.Ofek Weiss
01/08/2024, 3:26 PMFlora Schneider
01/09/2024, 6:46 AMmichael böhm
07/16/2024, 11:35 AM