Fix custom_repr assignment in instantiate_custom_component function (#1828)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-05-02 18:32:13 -03:00 committed by GitHub
commit 354a236bc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -185,7 +185,7 @@ async def instantiate_custom_component(params, user_id, vertex):
# Call the build method directly if it's sync
build_result = custom_component.build(**params_copy)
custom_repr = custom_component.custom_repr()
if not custom_repr and isinstance(build_result, (dict, Record, str)):
if custom_repr is None and isinstance(build_result, (dict, Record, str)):
custom_repr = build_result
if not isinstance(custom_repr, str):
custom_repr = str(custom_repr)