diff --git a/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py b/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py index 2db614f7b17..7c65b649046 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py +++ b/sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py @@ -280,7 +280,10 @@ def pull_all_from_table_or_query( if created_timestamp_column: timestamp_fields.append(created_timestamp_column) field_string = ", ".join( - join_key_columns + feature_name_columns + timestamp_fields + _append_alias( + join_key_columns + feature_name_columns + timestamp_fields, + "paftoq_alias", + ) ) timestamp_filter = get_timestamp_filter_sql( diff --git a/sdk/python/tests/unit/infra/offline_stores/contrib/postgres_offline_store/test_postgres.py b/sdk/python/tests/unit/infra/offline_stores/contrib/postgres_offline_store/test_postgres.py index 3a43b805607..ce98315eef4 100644 --- a/sdk/python/tests/unit/infra/offline_stores/contrib/postgres_offline_store/test_postgres.py +++ b/sdk/python/tests/unit/infra/offline_stores/contrib/postgres_offline_store/test_postgres.py @@ -184,7 +184,7 @@ def test_pull_all_from_table_or_query(mock_get_conn): actual_query = retrieval_job.to_sql().strip() logger.debug("Actual query:\n%s", actual_query) - expected_query = """SELECT key1, key2, feature1, feature2, event_published_datetime_utc + expected_query = """SELECT paftoq_alias."key1", paftoq_alias."key2", paftoq_alias."feature1", paftoq_alias."feature2", paftoq_alias."event_published_datetime_utc" FROM offline_store_database_name.offline_store_table_name AS paftoq_alias WHERE "event_published_datetime_utc" BETWEEN '2021-01-01 00:00:00+00:00'::timestamptz AND '2021-01-02 00:00:00+00:00'::timestamptz""" # noqa: W293