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

feat(Python): Allow left/center as table cell alignment format for notebooks #15830

Closed
wants to merge 35 commits into from

Conversation

lisphilar
Copy link

@lisphilar lisphilar commented Apr 22, 2024

Close #15822

We use polars.Config.set_tbl_cell_alignment() to change the table cell alignment format for print(pl.DataFrame()).
This PR enables change format of display(pl.DataFrame()) output on Jupyter Notebook and Google Colab.

To-do

  • NotebookFormatter.write_style() selects text-align reading "POLARS_FMT_TABLE_CELL_ALIGNMENT" env variable
  • NotebookFormatter.write_style() selects text-align reading "POLARS_FMT_TABLE_CELL_NUMERIC_ALIGNMENT"
  • update docs of polars.Config.set_tbl_cell_alignment()
  • update docs of polars.Config.set_tbl_cell_numeric_alignment()
  • add additional test for display (if possible)

@github-actions github-actions bot added the enhancement New feature or an improvement of an existing feature label Apr 22, 2024
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.37%. Comparing base (1c6b7b7) to head (1eaac8a).
Report is 37 commits behind head on main.

❗ Current head 1eaac8a differs from pull request most recent head 2c9c3af. Consider uploading reports for the commit 2c9c3af to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15830      +/-   ##
==========================================
- Coverage   80.38%   80.37%   -0.01%     
==========================================
  Files        1263     1263              
  Lines      165368   165368              
==========================================
- Hits       132923   132916       -7     
- Misses      32445    32452       +7     

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

@alexander-beedie
Copy link
Collaborator

Given the number of lint-related issues I see you had to address, can I check if you have seen the make pre-commit command? It will run all of the standard linti/format rules on your code before you commit (and can fix issues that are found).

@lisphilar
Copy link
Author

I will try PR updates this weekend.

@lisphilar lisphilar closed this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow left/center as table cell alignment format for notebooks
2 participants