-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: Fix NamedEntityExtractor serde #7684
Conversation
Pull Request Test Coverage Report for Build 9076600918Details
💛 - Coveralls |
@@ -216,6 +216,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "NamedEntityExtractor": | |||
try: | |||
init_params = data["init_parameters"] | |||
init_params["device"] = ComponentDevice.from_dict(init_params["device"]) | |||
init_params["backend"] = NamedEntityExtractorBackend[init_params["backend"]] |
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.
I'm a bit confused; where is this init_params
used? it it's never used inside this function
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.
OK, nevermind, I understood now what's going on :)
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.
LGTM
@davidsbatista there was a conflict with main branch commit that I needed to resolve. I also took the opportunity to remove unit test markers as we don't use them any more. Please double check again everything 🙏 |
* Fix NamedEntityExtractor serde * Add release note * Linting, remove unit markers
Why:
Fixes serialization and deserialization (serde) in the
NamedEntityExtractor
component. Important for usecases whereNamedEntityExtractor
needs to be serialized to a pipeline yaml file.What:
.name
on the_backend.type
attribute, ensuring that it is stored as a string rather than an object reference.backend
string back into the correctNamedEntityExtractorBackend
enumeration before attempting to use it in constructing aNamedEntityExtractor
instance.NamedEntityExtractor
can be serialized and deserialized correctly, particularly when used within a pipeline configuration.How can it be used:
NamedEntityExtractor
to a yaml fileNamedEntityExtractor
configuration to resume processing or to replicate a specific setup across different environments or applications.Example of serializing and deserializing a pipeline including a
NamedEntityExtractor
:How did you test it:
NamedEntityExtractor
to include checks for both serialization and deserialization functionality, confirming that the process retains the correct component configurations.NamedEntityExtractor
within a pipeline configuration, ensuring that the entire pipeline can be serialized and deserialized correctly. This test verifies that the pipeline's dictionary representation remains consistent before and after the serde.Notes for the reviewer: