Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Mar 8, 2025

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.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Weves Weves requested a review from a team as a code owner March 8, 2025 02:48
Copy link

vercel bot commented Mar 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2025 3:06am

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

"""String representation of the checkpoint, with truncation for large checkpoint content."""
MAX_CHECKPOINT_CONTENT_CHARS = 1000

content_str = str(self.checkpoint_content)
Copy link
Contributor

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

@rkuo-danswer rkuo-danswer added this pull request to the merge queue Mar 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants