Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed on fetching historical feature values with get_historical_features python API #3495

Closed
tsenhungwu opened this issue Feb 15, 2023 · 2 comments
Labels
kind/bug priority/p2 wontfix This will not be worked on

Comments

@tsenhungwu
Copy link

tsenhungwu commented Feb 15, 2023

Expected Behavior

get_historical_features should return a joined result with feature view or views as expected but I am unable to see the results.

Current Behavior

get_historical_features throws out an error
"ProgrammingError: (pyodbc.ProgrammingError) ('42000', "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]String or binary data would be truncated in table 'feature-store.dbo.feast_entity_df_3dada85cfda44050b3d22b896579ba2f', column 'customer_id'. Truncated value: 'D'. (2628) (SQLExecDirectW)")"

Steps to reproduce

  1. Create an entity with "customer_id" as a string type.
  2. Create a feature view that links to the above entity.
  3. Feast apply in a shell script.
  4. Execute get_historical_features.

Specifications

  • Version: Python==3.8, feast==0.28.0
  • Platform: Azure
  • Subsystem: Both registry and offline store are Azure MSSQL and the online store is Azure cache for Redis

Possible Solution

  1. I looked into the source code and if I understand the backend correctly, when a user triggers "get_historical_features", at a very high level, Feast executes three steps: 1) create a temp table 2) insert row(s) based on what was submitted in one's entity_df parameter 3) ready for point-in-time correctness join with feature view data.
  2. Root cause was found post the temp table formation from step 1. For a string type of data or entity in my case, Feast transfers the data type into "varchar" without inferring its length. Therefore, from the DDL pov, SQL server would interpret it as varchar(1) and this is why steps 2 and 3 both failed afterward.
  3. Proposed resolutions: In the file "type_map.py", function "pa_to_mssql_type" line 601 is the root cause. I would propose two solutions, either make a large number within varchar like varchar(max) or perform some dynamic length checks upfront. I kinda prefer the former as performing some additional checks would take more time and further delay the following operation.
@stale
Copy link

stale bot commented Aug 10, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 10, 2023
@stale stale bot closed this as completed Sep 17, 2023
@renziver
Copy link

This issue still persists. Hard to work with FEAST on Azure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug priority/p2 wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants