fix-base-component-set-method (#4347)

Update component.py

Updated `_process_connection_or_parameters` to handle lists of components more robustly, ensuring it excludes lists containing `Message` or `Data` types.
This commit is contained in:
Edwin Jose 2024-11-01 04:39:08 -04:00 committed by GitHub
commit 9b898a0351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -444,7 +444,9 @@ class Component(CustomComponent):
def _process_connection_or_parameters(self, key, value) -> None:
# if value is a list of components, we need to process each component
# Note this update make sure it is not a list str | int | float | bool | type(None)
if isinstance(value, list) and not any(isinstance(val, str | int | float | bool | type(None)) for val in value):
if isinstance(value, list) and not any(
isinstance(val, str | int | float | bool | type(None) | Message | Data) for val in value
):
for val in value:
self._process_connection_or_parameter(key, val)
else: