From cd7d7d237448688a9de7dc9e646a278bedcc0a68 Mon Sep 17 00:00:00 2001 From: kkochanovskiy Date: Tue, 13 May 2025 11:08:14 +0300 Subject: [PATCH] fix: wrap table_subquery in subquery alias for Trino syntax compatibility Signed-off-by: kkochanovskiy --- README.md | 6 ++---- .../offline_stores/contrib/trino_offline_store/trino.py | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 39a295e8f65..c6984fd8532 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![PyPI - Downloads](https://img.shields.io/pypi/dm/feast)](https://pypi.org/project/feast/) [![GitHub contributors](https://img.shields.io/github/contributors/feast-dev/feast)](https://github.com/feast-dev/feast/graphs/contributors) -[![unit-tests](https://github.com/feast-dev/feast/actions/workflows/unit_tests.yml/badge.svg?branch=master&event=pull_request)](https://github.com/feast-dev/feast/actions/workflows/unit_tests.yml) +[![unit-tests](https://github.com/feast-dev/feast/actions/workflows/unit_tests.yml/badge.svg?branch=master)](https://github.com/feast-dev/feast/actions/workflows/unit_tests.yml) [![integration-tests-and-build](https://github.com/feast-dev/feast/actions/workflows/master_only.yml/badge.svg?branch=master&event=push)](https://github.com/feast-dev/feast/actions/workflows/master_only.yml) [![java-integration-tests](https://github.com/feast-dev/feast/actions/workflows/java_master_only.yml/badge.svg?branch=master&event=push)](https://github.com/feast-dev/feast/actions/workflows/java_master_only.yml) [![linter](https://github.com/feast-dev/feast/actions/workflows/linter.yml/badge.svg?branch=master&event=push)](https://github.com/feast-dev/feast/actions/workflows/linter.yml) @@ -21,8 +21,6 @@ ## Join us on Slack! 👋👋👋 [Come say hi on Slack!](https://communityinviter.com/apps/feastopensource/feast-the-open-source-feature-store) -[Check out our DeepWiki!](https://deepwiki.com/feast-dev/feast) - ## Overview Feast (**Fea**ture **St**ore) is an open source feature store for machine learning. Feast is the fastest path to manage existing infrastructure to productionize analytic data for model training and online inference. @@ -259,4 +257,4 @@ Thanks goes to these incredible people: - + \ No newline at end of file diff --git a/sdk/python/feast/infra/offline_stores/contrib/trino_offline_store/trino.py b/sdk/python/feast/infra/offline_stores/contrib/trino_offline_store/trino.py index 7f7b91d1d23..d397e7674e4 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/trino_offline_store/trino.py +++ b/sdk/python/feast/infra/offline_stores/contrib/trino_offline_store/trino.py @@ -590,7 +590,9 @@ def _get_entity_df_event_timestamp_range( {% for feature in featureview.features %} {{ feature }} as {% if full_feature_names %}{{ featureview.name }}__{{featureview.field_mapping.get(feature, feature)}}{% else %}{{ featureview.field_mapping.get(feature, feature) }}{% endif %}{% if loop.last %}{% else %}, {% endif %} {% endfor %} - FROM {{ featureview.table_subquery }} + FROM ( + {{ featureview.table_subquery }} + ) AS {{ featureview.name }}__subquery WHERE {{ featureview.timestamp_field }} <= from_iso8601_timestamp('{{ featureview.max_event_timestamp }}') {% if featureview.ttl == 0 %}{% else %} AND {{ featureview.timestamp_field }} >= from_iso8601_timestamp('{{ featureview.min_event_timestamp }}')