Title: Bug: TypeError / ValueError when materializing Array(String) feature views with Athena offline store · Issue #6325 · feast-dev/feast · GitHub
Open Graph Title: Bug: TypeError / ValueError when materializing Array(String) feature views with Athena offline store · Issue #6325 · feast-dev/feast
X Title: Bug: TypeError / ValueError when materializing Array(String) feature views with Athena offline store · Issue #6325 · feast-dev/feast
Description: Description Materializing feature views that contain Array(String) columns using the Athena offline store fails intermittently with one of two errors: Error 1: ValueError: The truth value of an empty array is ambiguous Triggered when an ...
Open Graph Description: Description Materializing feature views that contain Array(String) columns using the Athena offline store fails intermittently with one of two errors: Error 1: ValueError: The truth value of an emp...
X Description: Description Materializing feature views that contain Array(String) columns using the Athena offline store fails intermittently with one of two errors: Error 1: ValueError: The truth value of an emp...
Opengraph URL: https://github.com/feast-dev/feast/issues/6325
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: TypeError / ValueError when materializing Array(String) feature views with Athena offline store","articleBody":"## Description\n\nMaterializing feature views that contain `Array(String)` columns using the Athena offline store fails intermittently with one of two errors:\n\n### Error 1: `ValueError: The truth value of an empty array is ambiguous`\n\nTriggered when an entity row has no values set for an array column (e.g. `tags = []`).\n\n```\nFile \".../feast/type_map.py\", line 772, in _python_value_to_proto_value\n elif not pd.isnull(value):\nValueError: The truth value of an empty array is ambiguous. Use `array.size \u003e 0` to check that an array is not empty.\n```\n\n### Error 2: `TypeError: bad argument type for built-in operation`\n\nTriggered when any user has values in an array column.\n\n```\nFile \".../feast/type_map.py\", line 905, in \u003clistcomp\u003e\n ProtoValue(**{field_name: proto_type(val=value)})\nTypeError: bad argument type for built-in operation\n```\n\n## Root Cause\n\nArrow/Athena deserializes `Array(String)` feature columns as `numpy.ndarray` with `object` dtype rather than plain Python lists. Two code paths in `type_map.py` do not handle this:\n\n1. **Scalar null-check** (`_convert_scalar_values_to_proto`): The line `elif not pd.isnull(value)` calls `pd.isnull()` on a numpy array, which returns an array of bools — then `not \u003carray\u003e` raises `ValueError` because the truth value is ambiguous.\n\n2. **Generic list conversion** (`_convert_list_values_to_proto`): The call `proto_type(val=value)` passes the raw `numpy.ndarray` directly to the protobuf constructor. Protobuf rejects non-list types and raises `TypeError`. Additionally, Arrow nullable columns can produce `None` elements inside the ndarray, which protobuf `StringList` also rejects.\n\n3. **Type validation** (`_validate_collection_item_types`): `None` elements inside an ndarray fail the `type(item) in valid_types` check before they can be sanitized downstream.\n\n## Steps to Reproduce\n\n1. Define a `FeatureView` with an `Array(String)` field:\n ```python\n Field(name=\"tags\", dtype=Array(String))\n ```\n2. Materialize from Athena where some rows have non-empty arrays, some have empty arrays, and some have NULL values in array elements.\n3. Observe `ValueError` or `TypeError` in `feast/type_map.py`.\n\n## Expected Behavior\n\nMaterialization completes successfully. Array columns from Arrow/Athena are converted to proto-safe Python lists, with `None` elements replaced by empty string.\n\n## Environment\n\n- Feast version: (any version with the generic list proto conversion)\n- Offline store: Athena\n- Python: 3.11\n- Feature column type: `Array(String)` (maps to `ValueType.STRING_LIST`)\n\n## Fix\n\nI opened a PR with a fix for this issue: https://github.com/feast-dev/feast/pull/6324","author":{"url":"https://github.com/alan-gauthier-jt","@type":"Person","name":"alan-gauthier-jt"},"datePublished":"2026-04-24T08:19:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/6325/feast/issues/6325"}
| 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:25800d8d-fa81-caf6-5b80-c196704a0d5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB14:C0192:1F88:28C2:6A4E60BB |
| html-safe-nonce | 1df20d443c79ecd78c171bad834aed51539e9ac95d33e9225e171f5f974e2db8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjE0OkMwMTkyOjFGODg6MjhDMjo2QTRFNjBCQiIsInZpc2l0b3JfaWQiOiI2OTYxNjU0NzIwMjY0ODIyOTcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5d02d27647298cdf746e140928b97da5e1e2ca215fbaf38feff7f086c5e846b7 |
| hovercard-subject-tag | issue:4321609457 |
| 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/6325/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7a6e6d6a03c323ba941f8149df7ecd46b9f37e94427e24f89cbf986f9db48dbd/feast-dev/feast/issues/6325 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7a6e6d6a03c323ba941f8149df7ecd46b9f37e94427e24f89cbf986f9db48dbd/feast-dev/feast/issues/6325 |
| og:image:alt | Description Materializing feature views that contain Array(String) columns using the Athena offline store fails intermittently with one of two errors: Error 1: ValueError: The truth value of an emp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alan-gauthier-jt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width