Skip to content

Commit

Permalink
Update most docstring code output with current Polars formatting.
Browse files Browse the repository at this point in the history
Update most docstring code output with current Polars formatting:
  - doctest output checking was disabled in the past as Polars
    output/formatting was still changing a lot (like float printing).
  - Almost all doctest pass now without need to silence the output.
  - Some code examples were incomplete or wrong.
  - There are stil a few failing docstrings mostly related to time series.
  - Soon run_doc_examples.py can be run again with:
    `IGNORE_RESULT_ALL = False`
  • Loading branch information
ghuls authored and ritchie46 committed Jul 6, 2022
1 parent 1dbd211 commit 93da58c
Show file tree
Hide file tree
Showing 8 changed files with 797 additions and 711 deletions.
12 changes: 12 additions & 0 deletions py-polars/polars/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ def set_tbl_cols(cls, n: int) -> type[Config]:
╞═════╪═════╪═════╪═════╪═════╪═════╡
│ 0 ┆ 1 ┆ 2 ┆ ... ┆ 98 ┆ 99 │
└─────┴─────┴─────┴─────┴─────┴─────┘
>>> pl.cfg.Config.set_tbl_cols(10)
>>> df
shape: (1, 100)
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ 0 ┆ 1 ┆ 2 ┆ 3 ┆ 4 ┆ ... ┆ 95 ┆ 96 ┆ 97 ┆ 98 ┆ 99 │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ i64 ┆ i64 ┆ i64 ┆ ┆ i64 ┆ i64 ┆ i64 ┆ i64 ┆ i64 │
╞═════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╡
│ 0 ┆ 1 ┆ 2 ┆ 3 ┆ 4 ┆ ... ┆ 95 ┆ 96 ┆ 97 ┆ 98 ┆ 99 │
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
"""

os.environ["POLARS_FMT_MAX_COLS"] = str(n)
Expand Down

0 comments on commit 93da58c

Please sign in to comment.