Skip to content

fix(enterprise): escape pipes and newlines in Markdown Actions table - #404

Merged
kevincostner17 merged 1 commit into
mainfrom
fix/md-table-pipes-338
Sep 15, 2026
Merged

kevincostner17 merged 1 commit into
mainfrom
fix/md-table-pipes-338

Conversation

@kevincostner17

Copy link
Copy Markdown
Contributor

Supersedes #355. This PR carries @cnYui's original commit unchanged, with authorship preserved, rebased onto current main. The only change is resolving the CHANGELOG.md conflict 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.

  • A new _md_escape_cell() escapes | as \| and turns \r\n, \r and \n into <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 main cbd1967 plus this commit:

  • ruff check .: passed
  • mypy src/freshdata: no issues
  • pytest -m "not online and not large", Python 3.12: 5592 passed, 13 skipped
  • pytest -m "not online and not large", Python 3.9 / pandas 1.5: 5588 passed, 17 skipped

Closes #338

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
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0788f011-bdb9-4623-900d-376a69b1417c


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

FreshData benchmark report — performance

  • freshdata: ?
  • python: ?
  • platform: ?
fixture n_rows n_cols p50 s p95 s peak MB repair % false-repair % preserve % trust monotonic export %

Authored-code reduction (Metric 6)

@kevincostner17
kevincostner17 merged commit 9d81904 into main Sep 15, 2026
21 checks passed
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.

QualityReport.to_markdown breaks the Actions table when a column name contains '|'

2 participants