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,rust): updated default table format from "UTF8_FULL" to "UTF8_FULL_CONDENSED" #5967

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Dec 31, 2022

Closes #5942


Format updates

  • Changes default UTF8 table format from UTF8_FULL to UTF8_FULL_CONDENSED.
  • Changes default ASCII table format from ASCII_FULL to ASCII_FULL_CONDENSED (requiring comfy-table 6.1.4).
  • Updates all docstrings to match the new format (in both Python & Rust).
# shape: (3, 3)                    shape: (3, 3) 
# ┌────────────┬─────┬──────┐      ┌────────────┬─────┬──────┐
# │ dt         ┆ x   ┆ y    │      │ dt         ┆ x   ┆ y    │
# │ ---        ┆ --- ┆ ---  │      │ ---        ┆ --- ┆ ---  │
# │ date       ┆ f64 ┆ f64  │      │ date       ┆ f64 ┆ f64  │
# ╞════════════╪═════╪══════╡      ╞════════════╪═════╪══════╡
# │ 2022-12-26 ┆ 3.5 ┆ 10.0 │      │ 2022-12-26 ┆ 3.5 ┆ 10.0 │
# ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌┤      │ 2022-12-27 ┆ 4.0 ┆ 2.5  │
# │ 2022-12-27 ┆ 4.0 ┆ 2.5  │  >>  │ 2022-12-28 ┆ 1.0 ┆ 1.5  │
# ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌┤      │ 2022-12-29 ┆ 6.0 ┆ 6.0  │
# │ 2022-12-28 ┆ 1.0 ┆ 1.5  │      │ 2022-12-30 ┆ 0.0 ┆ 11.5 │
# ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌┤      │ 2022-12-31 ┆ 2.0 ┆ 0.0  │
# │ 2022-12-29 ┆ 6.0 ┆ 6.0  │      └────────────┴─────┴──────┘
# ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌┤
# │ 2022-12-30 ┆ 0.0 ┆ 11.5 │
# ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌┤      (improves usage of vertical space)
# │ 2022-12-31 ┆ 2.0 ┆ 0.0  │
# └────────────┴─────┴──────┘

Also

  • Registers a doctest tearDown function to prevent any pl.Config changes inside docstrings from leaking scope.
  • Adds a note inside the sign docstring to explicitly state the expected return values: -1 (+ve), 0 (zero), 1 (-ve).

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Dec 31, 2022
@ritchie46
Copy link
Member

Big thanks to the man who gets superpowers from a cup of tea. ^^

@ritchie46 ritchie46 merged commit 4703ca3 into pola-rs:master Dec 31, 2022
@alexander-beedie
Copy link
Collaborator Author

alexander-beedie commented Dec 31, 2022

Lol.... never leave home without one! ☕
Happy New Year :)

@alexander-beedie alexander-beedie deleted the updated-tableformat-default branch January 5, 2023 19:40
zundertj pushed a commit to zundertj/polars that referenced this pull request Jan 7, 2023
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 python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pl.Config.set_tbl_formatting("UTF8_FULL_CONDENSED") as default for printing Dataframes
2 participants