fix: support SQL string as entity_df in RemoteOfflineStore.get_historical_features#6265
Open
korbonits wants to merge 1 commit intofeast-dev:masterfrom
Open
fix: support SQL string as entity_df in RemoteOfflineStore.get_historical_features#6265korbonits wants to merge 1 commit intofeast-dev:masterfrom
korbonits wants to merge 1 commit intofeast-dev:masterfrom
Conversation
…ical_features When entity_df is a SQL string, route it through api_parameters["entity_df_sql"] instead of calling pa.Table.from_pandas() on it (which raised AttributeError). The OfflineServer now forwards entity_df_sql from the command dict directly to the backing offline store, matching the behaviour of local stores that already support SQL entity_df. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Alex Korbonits <alex@korbonits.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6236
Summary
Fixes
AttributeError: 'str' object has no attribute 'columns'when passing a SQL string asentity_dftoRemoteOfflineStore.get_historical_features().remote.py: Ifentity_dfis astr, stash it asapi_parameters["entity_df_sql"]and setentity_df=Nonebefore building theRemoteRetrievalJob. Also fixes_create_retrieval_metadatato return a stub (empty keys, no timestamps) for SQL strings instead of crashing on.columns.offline_server.py: After the existing empty-table detection, check forentity_df_sqlin the command dict and forward it as-is to the backing offline store.Local offline stores (ClickHouse, PostgreSQL, BigQuery, DuckDB) already support SQL
entity_df; this fix makesRemoteOfflineStorea transparent pass-through for that case.Test plan
test_create_retrieval_metadata_with_sql_string— verifies the metadata helper returns a valid stub for a SQL stringtest_remote_offline_store_sql_entity_df_routing— verifies the client moves a SQL string intoapi_parameters["entity_df_sql"]and passesentity_df=Noneto the jobtest_offline_server_get_historical_features_passes_sql_to_store— verifies the server forwardsentity_df_sqlas a string to the backing storetest_offline_server.pytests pass (7/7)🤖 Generated with Claude Code