Visitar URL original
fix: Materialize API - ODFV views not looked-up (thinks views non existant) - crashes materialize by astronautas · Pull Request #5716 · feast-dev/feast · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add pull_all_from_table_or_query for clickhouse, to align with new ma…
…terialization logic (calling it)

Signed-off-by: lukas.valatka <lukas.valatka@cast.ai>
  • Loading branch information
astronautas authored and ntkathole committed Oct 15, 2025
commit 1752a4fc72f72ac5e7c059f028940e656db5b50b
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,43 @@ def pull_latest_from_table_or_query(
on_demand_feature_views=None,
)

@staticmethod
def pull_all_from_table_or_query(
config: RepoConfig,
data_source: DataSource,
join_key_columns: List[str],
feature_name_columns: List[str],
timestamp_field: str,
created_timestamp_column: Optional[str] = None,
start_date: Optional[datetime] = None,
end_date: Optional[datetime] = None,
) -> RetrievalJob:
assert isinstance(config.offline_store, ClickhouseOfflineStoreConfig)
assert isinstance(data_source, ClickhouseSource)

from_expression = data_source.get_table_query_string()

timestamp_fields = [timestamp_field]

if created_timestamp_column:
timestamp_fields.append(created_timestamp_column)

field_string = ", ".join(
join_key_columns + feature_name_columns + timestamp_fields
)

query = f"""
SELECT {field_string}
FROM {from_expression}
WHERE {timestamp_field} BETWEEN parseDateTimeBestEffort('{start_date}') AND parseDateTimeBestEffort('{end_date}')
"""

return ClickhouseRetrievalJob(
query=query,
config=config,
full_feature_names=False,
)


class ClickhouseRetrievalJob(PostgreSQLRetrievalJob):
def _to_df_internal(self, timeout: Optional[int] = None) -> pd.DataFrame:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ def offline_types_test_fixtures(request, environment):
if (
environment.data_source_creator.__class__.__name__
== "ClickhouseDataSourceCreator"
and config.feature_dtype in {"float", "datetime", "bool"}
and config.feature_is_list
and not config.has_empty_list
):
Expand Down
Loading