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

fix(python): Replace spaces with   to support showing multiple spaces in HTML repr #19783

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

TNieuwdorp
Copy link
Contributor

@TNieuwdorp TNieuwdorp commented Nov 14, 2024

Fixes #19665

Before:
image

After:
image

I've added a small unit test that checks for a right output for the repr in test_repr_html.py, not sure if it's the correct location. Please let me know.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Nov 14, 2024
@TNieuwdorp TNieuwdorp force-pushed the bugfix/multiple-spaces-html branch 3 times, most recently from e0351a7 to a3c0ece Compare November 14, 2024 12:57
@TNieuwdorp TNieuwdorp requested a review from orlp as a code owner November 14, 2024 12:57
@TNieuwdorp TNieuwdorp force-pushed the bugfix/multiple-spaces-html branch from a3c0ece to e775f89 Compare November 14, 2024 13:02
@TNieuwdorp TNieuwdorp marked this pull request as draft November 14, 2024 13:10
@TNieuwdorp TNieuwdorp marked this pull request as ready for review November 14, 2024 13:14
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.56%. Comparing base (420c0d9) to head (d0e270b).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #19783    +/-   ##
========================================
  Coverage   79.55%   79.56%            
========================================
  Files        1544     1545     +1     
  Lines      213240   213442   +202     
  Branches     2441     2444     +3     
========================================
+ Hits       169645   169815   +170     
- Misses      43046    43077    +31     
- Partials      549      550     +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@alexander-beedie alexander-beedie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the test I wouldn't assert quite so much detail, in case other (unrelated) formatting/elements change in the future - just assert that the strings which should now contain   are all present in the html_repr output?
Aside from that minor nit, looks good to go 😎

@TNieuwdorp
Copy link
Contributor Author

I'm using a regex for it, which I've elaborated with a comment above because regex is like arcane magic when you don't write it yourself

@TNieuwdorp TNieuwdorp force-pushed the bugfix/multiple-spaces-html branch from e95dfe6 to d0e270b Compare November 15, 2024 09:53
@alexander-beedie
Copy link
Collaborator

I'm using a regex for it, which I've elaborated with a comment above because regex is like arcane magic when you don't write it yourself

I speak fluent regex ✌️😎

image

@alexander-beedie alexander-beedie merged commit 5515b2c into pola-rs:main Nov 15, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Escape multiple spaces in HTML
2 participants