-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Excessive Debug Logs in recursive_serialize_or_str Function #4110
Comments
Hey @dhlidongming! I'm here to help you with any bugs, questions, or contributions you have for Langflow. Let's work together to solve this issue. To address the excessive debug logs in the
These changes should help reduce excessive logging and fix the |
I would like to report the same issue. The following line of code is issuing the following error:
Here is a simple flow to reproduce the error: As highlighted by @dhlidongming, the impact of this bug is significantly slowing down the whole flow time execution when you have multiple items in a dictionary. |
Hey @dhlidongming We made some changes to the logging and that must have passed under the radar. Thanks for the report! We'll fix it right away. |
Bug Description
I've noticed that the
recursive_serialize_or_str
function in schema/schema.py generates excessive debug-level logs when processing dictionaries with many key-value pairs. This excessive logging leads to increased execution time for some components.The method performs recursive calls for dictionaries, and when handling strings, it checks for
issubclass(BaseModel)
, which can throw an exception. Although the exception is caught and handled by treating the value as a string, the large number of keys in the dictionary can still result in a significant amount of debug logs being produced.Reproduction
API Request
) that outputs a large dictionary.recursive_serialize_or_str
method with this dictionary.Expected behavior
Handle the str type correctly, or ensure that each dictionary generates only one log instead of one for each value.
Who can help?
@italojohnny @ogabrielluiz
Operating System
Ubuntu Linux 22.04
Langflow Version
1.0.19
Python Version
3.12
Screenshot
Flow File
No response
The text was updated successfully, but these errors were encountered: