-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 #15915
base: main
Are you sure you want to change the base?
Conversation
…tebooks pola-rs#15822 * feat: set text_align with POLARS_FMT_TABLE_CELL_ALIGNMENT env variable * docs: mention expected impact of set_tbl_cell_alignment in docstring * fix: KeyError when un-assigned * docs: fix W505 Doc line too long (111 > 88) * docs: fix D205 1 blank line required between summary line and description * fix: text_align tag is not lower case * feat: set numeric text align with POLARS_FMT_TABLE_CELL_NUMERIC_ALIGNMENT env variable * docs: mention expected impact of set_tbl_cell_numeric_alignment in docstring * docs: fix D417 Missing argument description in the docstring for `get_attributes`: `col_idx` * docs: update docstring for clarification * refactor: access environment variables at DataFrame level * docs: fix D213 [*] Multi-line docstring summary should start at the second line * docs: fix W505 Doc line too long (99 > 88) * fix: F821 Undefined name `numeric_align` * test: add tests with _repr_html and table cell alignment settings * fix: AttributeError * fix: lines too long * test: fix F541 [*] f-string without any placeholders * fix: lines too long * refactor: fix errors suggested by lint * refactor: reorder variable assignment * refactor: fix errors suggested by lint * refactor: fix error suggested by lint * test: remove unnecessary characters * test: fix errors suggested by lint * test: fix errors suggested by lint * test: fix errors suggested by lint * test: fix typo * fix: ignore[arg-type] for mypy * fix: Return value expected [return-value] * refactor: get attributes at once * fix: KeyError: '\n text-align' * fix: Value of type "set[dict[str, str] | None]" is not indexable * fix: KeyError by f-string with unescaped {} * refactor: fix format * fix: Value of type "Set[Dict[str, str]]" is not indexable * refactor * fix: used set mistakenly * fix: Key expression in dictionary comprehension has incompatible type "int"; expected type "str" [misc] * refactor * fix: Argument 3 to "Tag" has incompatible type "**Dict[str, str]"; expected "Optional[Dict[str, str]]" [arg-type] * fix: TypeError: Tag.__init__() got an unexpected keyword argument 'align' * fix: Value expression in dictionary comprehension has incompatible type "Optional[Dict[str, str]]"; expected type "Dict[str, str]" [misc] * fix: Value of type "dict[int, dict[str, str]] | None" is not indexable [index] * fix: repeated code outside conditional statement * refactor: accept code_reginement Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * refactor: accept code_reginement Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * Revert "refactor: accept code_reginement" This reverts commit 3b4a9b5. * Revert "refactor: accept code_reginement" This reverts commit 4e0d734. --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Catch up with the latest polars
Rust codes were not changed, but libunwind: stepWithCompactEncoding - invalid compact unwind encoding
error: test failed, to rerun pass `-p polars-sql --test statements` |
Sync with base
Sync with base
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15915 +/- ##
==========================================
- Coverage 80.96% 80.95% -0.01%
==========================================
Files 1386 1386
Lines 178379 178403 +24
Branches 3064 3069 +5
==========================================
+ Hits 144424 144427 +3
- Misses 33466 33485 +19
- Partials 489 491 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@alexander-beedie |
Closes #15822
We use
polars.Config.set_tbl_cell_alignment()
to change the table cell alignment format forprint(pl.DataFrame())
.This PR enables to change format of
display(pl.DataFrame())
outputs on Jupyter Notebook and Google Colab.To-do
NotebookFormatter.write_style()
selects text-align reading "POLARS_FMT_TABLE_CELL_ALIGNMENT" env variableNotebookFormatter.write_style()
selects text-align reading "POLARS_FMT_TABLE_CELL_NUMERIC_ALIGNMENT"polars.Config.set_tbl_cell_alignment()
polars.Config.set_tbl_cell_numeric_alignment()