-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Eliminate extremely long log line for large checkpointds #4236
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
Added a string representation method to ConnectorCheckpoint class to truncate long checkpoint content in logs, improving log readability and reducing log spam.
- Added
__str__
method in/backend/onyx/connectors/models.py
with 1000 character limit for checkpoint content - Implemented truncation with '...' suffix for content exceeding the limit
- Maintains checkpoint information visibility while preventing excessive log line length
1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
backend/onyx/connectors/models.py
Outdated
"""String representation of the checkpoint, with truncation for large checkpoint content.""" | ||
MAX_CHECKPOINT_CONTENT_CHARS = 1000 | ||
|
||
content_str = str(self.checkpoint_content) |
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.
logic: Converting checkpoint_content directly to string could fail for complex objects. Consider using json.dumps() for reliable serialization
Description
^
Log is here: https://github.com/danswer-ai/danswer/blob/main/backend/onyx/background/indexing/run_indexing.py#L430-L432
How Has This Been Tested?
Tested indexing locally
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.