Skip to content

Commit

Permalink
Fix Snowflake query template for entityless feature views
Browse files Browse the repository at this point in the history
Signed-off-by: hkuepers <[email protected]>
  • Loading branch information
hkuepers committed Dec 19, 2024
1 parent da7b74a commit 4b48655
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/python/feast/infra/offline_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,11 @@ def _get_entity_df_event_timestamp_range(
{% if featureview.created_timestamp_column %}
"{{ featureview.name }}__dedup" AS (
SELECT
{{ featureview.entities | map('tojson') | join(', ')}}{% if featureview.entities %},{% else %}{% endif %},
{{ featureview.entities | map('tojson') | join(', ')}}{% if featureview.entities %},{% else %}{% endif %}
"event_timestamp",
MAX("created_timestamp") AS "created_timestamp"
FROM "{{ featureview.table_subquery }}"
GROUP BY {{ featureview.entities | map('tojson') | join(', ')}}{% if featureview.entities %},{% else %}{% endif %}, "event_timestamp"
GROUP BY {{ featureview.entities | map('tojson') | join(', ')}}{% if featureview.entities %},{% else %}{% endif %} "event_timestamp"
),
{% endif %}
Expand All @@ -788,7 +788,9 @@ def _get_entity_df_event_timestamp_range(
FROM "{{ featureview.name }}__entity_dataframe" e
ASOF JOIN {% if featureview.created_timestamp_column %}"{{ featureview.name }}__dedup"{% else %}{{ featureview.table_subquery }}{% endif %} v
MATCH_CONDITION (e."entity_timestamp" >= v."{{ featureview.timestamp_field }}")
{% if featureview.entities %}
USING({% for entity in featureview.entities %}{% if not loop.first %},{% endif %}"{{ entity }}"{% endfor %})
{% endif %}
),
/*
Expand Down

0 comments on commit 4b48655

Please sign in to comment.