-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Add Set as feature type #5888
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
franciscojavierarceo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot we should not update the protobuf version
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
| _ = Array(Array(String)) | ||
|
|
||
|
|
||
| def test_set_feast_type(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot can we add a test for it in the On Demand Feature Views test for the set type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comprehensive Set type test in test_on_demand_python_transformation.py. The test verifies:
- Set types in On Demand Feature Views with both Python mode transformations
- Automatic deduplication when creating sets from data with duplicates
- Conversion from lists to sets (e.g.,
["Boston", "Boston", "Seattle"]→{"Boston", "Seattle"}) - Online feature retrieval returning native Python sets
- Type validation for Set[String] and Set[Int64]
See commit ba4c68e.
|
|
||
| DESCRIPTOR: google.protobuf.descriptor.FileDescriptor | ||
|
|
||
| @typing_extensions.final |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot why do we need this typing extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This typing_extensions pattern was already present in the original file before my changes. The conditional import (lines 11-14) provides backward compatibility - it uses the built-in typing module for Python 3.8+ and falls back to the typing_extensions package for older versions.
The only change from my recompilation is the addition of the @typing_extensions.final decorator (line 18), which was generated by mypy-protobuf 3.5.0. This decorator marks the class as final (cannot be subclassed) for better type safety.
If this pattern is causing issues, I can investigate using a different mypy-protobuf version that doesn't add these decorators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please revert all changes with the @typing_extensions.final decorator, it shouldn't be necessary. probably there's skew between your local development environment and the CI. Check the Makefile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all @typing_extensions.final decorators. The issue was using mypy-protobuf 3.5.0 instead of 3.3.0 (which matches the CI requirements). Reverted all proto files and recompiled with the correct versions: protobuf 4.25.1 and mypy-protobuf 3.3.0. The Set types are preserved and no @typing_extensions.final decorators remain. See commit 105b399.
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
What this PR does / why we need it:
Adds
Setas a feature type to store collections of unique values, eliminating the need to manually deduplicate lists or convert back from maps.Changes
INT32_SET,INT64_SET,STRING_SET,BYTES_SET,BOOL_SET,FLOAT_SET,DOUBLE_SET,UNIX_TIMESTAMP_SET) with corresponding message types. Compiled with protobuf version 4.25.1 and mypy-protobuf 3.3.0 to match CI environment requirements.Setclass intypes.pyfollowing the same pattern asArraytype_map.pywith automatic deduplicationSetTypeunion and enum values invalue_type.pytest_types.pyandtest_type_map.pytest_on_demand_python_transformation.pyvalidating Set types with automatic deduplication, list-to-set conversion, and online feature retrievaltype-system.mdwith set types table and usage examplesUsage
All primitive types except
Mapsupport set variants.Misc
Protobuf changes are backward compatible. Existing LIST and MAP types are unaffected. Generated protobuf files use protobuf 4.25.1 and mypy-protobuf 3.3.0, matching the versions specified in CI requirements to ensure consistency across environments.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.