Skip to content

Commit

Permalink
Merge pull request #742 from elementary-data/fix-no-timestamp-event-f…
Browse files Browse the repository at this point in the history
…reshness

fixed no timestamp event freshness query
  • Loading branch information
ofek1weiss authored Aug 4, 2024
2 parents 0538a9f + 9d16f3c commit 3b8748b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-warehouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ jobs:
- name: Start Postgres
if: inputs.warehouse-type == 'postgres'
working-directory: ${{ env.TESTS_DIR }}
run: docker-compose up -d postgres
run: docker compose up -d postgres

- name: Start Trino
if: inputs.warehouse-type == 'trino'
working-directory: ${{ env.TESTS_DIR }}
run: docker-compose -f docker-compose-trino.yml up -d
run: docker compose -f docker-compose-trino.yml up -d

- name: Setup Python
uses: actions/setup-python@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@
group by 1,2
{% endmacro %}

{% macro get_no_timestamp_event_freshness_query(monitored_table, metric_properties, full_table_name_str) %}
{% macro get_no_timestamp_event_freshness_query(metric, metric_properties) %}
select
{{ elementary.const_as_string(metric.name) }} as metric_name,
{{ elementary.const_as_string("event_freshness") }} as metric_type,
{{ elementary.timediff('second', elementary.edr_cast_as_timestamp("max({})".format(metric_properties.event_timestamp_column)), elementary.edr_quote(elementary.get_run_started_at())) }} as metric_value
from {{ monitored_table }}
from monitored_table
{% endmacro %}

0 comments on commit 3b8748b

Please sign in to comment.