Title: FeatureStore.get_online_features is broken with int64 vals · Issue #1908 · feast-dev/feast · GitHub
Open Graph Title: FeatureStore.get_online_features is broken with int64 vals · Issue #1908 · feast-dev/feast
X Title: FeatureStore.get_online_features is broken with int64 vals · Issue #1908 · feast-dev/feast
Description: Expected Behavior I should be able to use an int64 value as the join key value for an entity, when the value type is value_type=ValueType.INT64. Current Behavior Only values -2147483648 <= number <= 2147483647 can be used as the value. T...
Open Graph Description: Expected Behavior I should be able to use an int64 value as the join key value for an entity, when the value type is value_type=ValueType.INT64. Current Behavior Only values -2147483648 <= number <...
X Description: Expected Behavior I should be able to use an int64 value as the join key value for an entity, when the value type is value_type=ValueType.INT64. Current Behavior Only values -2147483648 <= numbe...
Opengraph URL: https://github.com/feast-dev/feast/issues/1908
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"FeatureStore.get_online_features is broken with int64 vals","articleBody":"## Expected Behavior \r\nI should be able to use an int64 value as the join key value for an entity, when the value type is `value_type=ValueType.INT64`.\r\n\r\n## Current Behavior\r\nOnly values -2147483648 \u003c= number \u003c= 2147483647 can be used as the value. This is equivalent to -2^31 \u003c= number \u003c= 2^31 - 1\r\n\r\n\r\n## Steps to reproduce\r\nSpecify a value greater than 2^31 - 1 as a the join key value when looking up values from the feature store.\r\n\r\n```\r\n\u003e\u003e\u003e fs.get_online_features(features=['driver_hourly_stats:conv_rate'], entity_rows=[{'driver_id': 2147483648}]).to_df()\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/usage.py\", line 202, in exception_logging_wrapper\r\n result = func(*args, **kwargs)\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/feature_store.py\", line 897, in get_online_features\r\n union_of_entity_keys,\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/feature_store.py\", line 924, in _populate_result_rows_from_feature_view\r\n requested_features=requested_features,\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/infra/passthrough_provider.py\", line 81, in online_read\r\n result = self.online_store.online_read(config, table, entity_keys)\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/infra/online_stores/redis.py\", line 190, in online_read\r\n redis_key_bin = _redis_key(project, entity_key)\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/infra/online_stores/helpers.py\", line 40, in _redis_key\r\n key: List[bytes] = [serialize_entity_key(entity_key), project.encode(\"utf-8\")]\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/infra/key_encoding_utils.py\", line 41, in serialize_entity_key\r\n val_bytes, value_type = _serialize_val(v.WhichOneof(\"val\"), v)\r\n File \"/Users/achal/tecton/feast/sdk/python/feast/infra/key_encoding_utils.py\", line 17, in _serialize_val\r\n return struct.pack(\"\u003cl\", v.int64_val), ValueType.INT64\r\nstruct.error: 'l' format requires -2147483648 \u003c= number \u003c= 2147483647\r\n```\r\n\r\n\r\n## Possible Solution\r\n\r\nThe trivial fix is to make [this line](https://github.com/feast-dev/feast/blob/dcae1606f53028ce5413567fb8b66f92cfef0f8e/sdk/python/feast/infra/key_encoding_utils.py#L17) use `\"q\"` as the format string, which refers to a `signed long long` value which is 8 bytes in size.\r\n\r\nChanging this behavior is a backwards incompatible change, since it would change the bytes encoded for an entity key which takes on int64 values. This means that materialized records oh that value type would would be unreadable.\r\n\r\nThe \"correct\" way of fixing this would require us to version the encoding scheme in the feature store.","author":{"url":"https://github.com/achals","@type":"Person","name":"achals"},"datePublished":"2021-09-25T02:50:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/1908/feast/issues/1908"}
| 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:d827e6b9-797b-be9d-7fb0-b8ad35fbbe4c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8750:15B1F7:1008D12:166DF2E:6978C310 |
| html-safe-nonce | b36fc29c34bd553140e99ad0017618789134d3dd4f7cab469609dc43d850c9ac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzUwOjE1QjFGNzoxMDA4RDEyOjE2NkRGMkU6Njk3OEMzMTAiLCJ2aXNpdG9yX2lkIjoiMzY1NTY0MjA0NTQ1NzQxNjk3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 38fd6856e434a755746989f0157e4a48208e8f029ca175403887aeda96e3057f |
| hovercard-subject-tag | issue:1006938287 |
| 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/1908/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3af37fbc3d3cf202aceaabb6f8215949723ca8677ba01d13a4e7d786dca9388f/feast-dev/feast/issues/1908 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3af37fbc3d3cf202aceaabb6f8215949723ca8677ba01d13a4e7d786dca9388f/feast-dev/feast/issues/1908 |
| og:image:alt | Expected Behavior I should be able to use an int64 value as the join key value for an entity, when the value type is value_type=ValueType.INT64. Current Behavior Only values -2147483648 <= number <... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | achals |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| 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 | 9520342ca7ead2f1a011aa96eaff82fc054a4970 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width