Repository navigation
Conversation
_display_result_table always rendered the "more rows not displayed" note as HTML via display(HTML(...)), which dumps raw markup in a terminal. Now checks is_in_ipython_notebook_environment() first and falls back to plain print() outside notebooks, matching how display_dataframe already handles the table itself. Closes stanfordnlp#10912 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
[Low impact] The change only reaches the evaluation table display workflow. The PR appears safe to merge, with a non-blocking request for regression tests. Findings
Summary
Reviews (1) · Last reviewed commit: "fix: Evaluate prints plain text truncati..." · Reviewed by Greptile |
| if is_in_ipython_notebook_environment(): | ||
| message = f""" | ||
| <div style=' | ||
| text-align: center; | ||
| font-size: 16px; | ||
| font-weight: bold; | ||
| color: #555; | ||
| margin: 10px 0;'> | ||
| ... {truncated_rows} more rows not displayed ... | ||
| </div> | ||
| """ | ||
| display(HTML(message)) | ||
| else: | ||
| print(f"\n... {truncated_rows} more rows not displayed ...\n") |
There was a problem hiding this comment.
New output branches lack tests
test_evaluate_display_table uses one example with display_table set to True, False, or 1, so it never reaches either changed branch. A later change could bring back HTML in terminal output without failing the tests.
Add a test with more examples than displayed rows. Check that terminal output contains the plain note without HTML and that notebook output still calls display with HTML.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Evaluate(display_table=N)always renders the truncation note as HTML viadisplay(HTML(...)), dumping raw markup in a terminalis_in_ipython_notebook_environment()check (already used bydisplay_dataframe) before the HTML pathprint()outside notebooksTest Plan
... 2 more rows not displayed ...Closes #10912
🤖 Generated with Claude Code