Title: Failed on fetching historical feature values with get_historical_features python API · Issue #3495 · feast-dev/feast · GitHub
Open Graph Title: Failed on fetching historical feature values with get_historical_features python API · Issue #3495 · feast-dev/feast
X Title: Failed on fetching historical feature values with get_historical_features python API · Issue #3495 · feast-dev/feast
Description: 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.Pr...
Open Graph Description: 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 ou...
X Description: 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 ou...
Opengraph URL: https://github.com/feast-dev/feast/issues/3495
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Failed on fetching historical feature values with get_historical_features python API","articleBody":"## Expected Behavior \r\nget_historical_features should return a joined result with feature view or views as expected but I am unable to see the results.\r\n\r\n## Current Behavior\r\nget_historical_features throws out an error \r\n\"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)\")\"\r\n\r\n## Steps to reproduce\r\n1. Create an entity with \"customer_id\" as a string type.\r\n2. Create a feature view that links to the above entity.\r\n3. `Feast apply` in a shell script.\r\n4. Execute `get_historical_features`.\r\n\r\n### Specifications\r\n- Version: Python==3.8, feast==0.28.0\r\n- Platform: Azure\r\n- Subsystem: Both registry and offline store are Azure MSSQL and the online store is Azure cache for Redis\r\n\r\n## Possible Solution\r\n1. 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.\r\n2. 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.\r\n3. 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.\r\n","author":{"url":"https://github.com/tsenhungwu","@type":"Person","name":"tsenhungwu"},"datePublished":"2023-02-15T14:50:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/3495/feast/issues/3495"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c130c1ee-8ef1-2c7e-ecce-337fb0fa3783 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B20:4209C:1F5445:2AB1B7:697CDE1F |
| html-safe-nonce | c3d25b5cf1f8ea341f5e50b93c85d1cb9c4f156b92f301db502d55e560486003 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjIwOjQyMDlDOjFGNTQ0NToyQUIxQjc6Njk3Q0RFMUYiLCJ2aXNpdG9yX2lkIjoiNDk4NjQ0NjYyMTQyNTA2NTUwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 95c08f6cde5af6618dee44dbe2aac18e3f94b9acfa378f54e313ae31b2372c25 |
| hovercard-subject-tag | issue:1585993694 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/3495/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f00b9fc9af80aebe18f2736a1549203ce86dbdb5c3290643f2b4120f95f0e033/feast-dev/feast/issues/3495 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f00b9fc9af80aebe18f2736a1549203ce86dbdb5c3290643f2b4120f95f0e033/feast-dev/feast/issues/3495 |
| og:image:alt | 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 ou... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tsenhungwu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f20df5019a7f846ce01350c443b1b5209bcc8b08d1ff80f92fdef440a0c7c89 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f08fae6208283a46e6e5febf9878b9cdddfaa23 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width