fix(enterprise): escape pipes and newlines in Markdown Actions table - #404
Merged
Merged
Conversation
QualityReport.to_markdown() escaped only the description cell, so a column name containing "|" added an extra cell and shifted the Actions row, and newlines in any cell split the row. Escape every cell inside _md_table_row instead: "|" becomes "\|" and line breaks become "<br>". The manual per-description escape is removed so values are no longer double-escaped. Fixes #338
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
FreshData benchmark report —
|
| fixture | n_rows | n_cols | p50 s | p95 s | peak MB | repair % | false-repair % | preserve % | trust | monotonic | export % |
|---|
Authored-code reduction (Metric 6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #355. This PR carries @cnYui's original commit unchanged, with authorship preserved, rebased onto current
main. The only change is resolving theCHANGELOG.mdconflict with the round-6 entries, keeping both bullets. Thank you @cnYui for the fix!Summary
QualityReport.to_markdown()built the Actions table by joining raw cell text with|. A column name or description containing|or a newline therefore added or split table columns. Only the description's pipes were escaped, and the column name wasn't escaped at all._md_escape_cell()escapes|as\|and turns\r\n,\rand\ninto<br>._md_table_row()applies it to every cell, which replaces the old description-only pipe escaping.Tests
tests/test_enterprise_metrics.py: column names and descriptions with pipes and newlines (\n,\r\n,\r) keep a well-formed table, with a constant column count per row.Verification
On
maincbd1967 plus this commit:ruff check .: passedmypy src/freshdata: no issuespytest -m "not online and not large", Python 3.12: 5592 passed, 13 skippedpytest -m "not online and not large", Python 3.9 / pandas 1.5: 5588 passed, 17 skippedCloses #338