Skip to content

Commit

Permalink
ci: Fix doctests (pola-rs#13831)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored and r-brink committed Jan 24, 2024
1 parent 0913be8 commit e521fa6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3907,9 +3907,9 @@ def estimated_size(self, unit: SizeUnit = "b") -> int | float:
... schema=[("x", pl.UInt32), ("y", pl.Float64), ("z", pl.String)],
... )
>>> df.estimated_size()
25888898
28000000
>>> df.estimated_size("mb")
24.689577102661133
26.702880859375
"""
sz = self._df.estimated_size()
return scale_bytes(sz, unit)
Expand Down
20 changes: 10 additions & 10 deletions py-polars/polars/expr/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,17 @@ def encode(self, encoding: TransferEncoding) -> Expr:
... )
>>> colors.with_columns(
... pl.col("code").bin.encode("hex").alias("code_encoded_hex"),
... )
... ) # doctest: +IGNORE_RESULT
shape: (3, 3)
┌────────┬───────────────┬──────────────────┐
│ name ┆ code ┆ code_encoded_hex │
│ --- ┆ --- ┆ --- │
│ str ┆ binary ┆ str │
╞════════╪═══════════════╪══════════════════╡
│ black ┆ [binary data] ┆ 000000 │
│ yellow ┆ [binary data] ┆ ffff00 │
│ blue ┆ [binary data] ┆ 0000ff │
└────────┴───────────────┴──────────────────┘
┌────────┬────────┬──────────────────┐
│ name ┆ code ┆ code_encoded_hex │
│ --- ┆ --- ┆ --- │
│ str ┆ binary ┆ str │
╞════════╪════════╪══════════════════╡
│ black ┆ b"" ┆ 000000 │
│ yellow ┆ b"��" ┆ ffff00 │
│ blue ┆ b"�" ┆ 0000ff │
└────────┴────────┴──────────────────┘
"""
if encoding == "hex":
return wrap_expr(self._pyexpr.bin_hex_encode())
Expand Down
14 changes: 7 additions & 7 deletions py-polars/polars/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,13 @@ def binary() -> SelectorType:
>>> df = pl.DataFrame({"a": [b"hello"], "b": ["world"], "c": [b"!"], "d": [":)"]})
>>> df
shape: (1, 4)
┌───────────────┬───────┬───────────────┬─────┐
│ a ┆ b ┆ c ┆ d │
│ --- ┆ --- ┆ --- ┆ --- │
│ binary ┆ str ┆ binary ┆ str │
╞═══════════════╪═══════╪═══════════════╪═════╡
[binary data] ┆ world ┆ [binary data] ┆ :) │
└───────────────┴───────┴───────────────┴─────┘
┌──────────┬───────┬────────┬─────┐
│ a ┆ b ┆ c ┆ d │
│ --- ┆ --- ┆ --- ┆ --- │
│ binary ┆ str ┆ binary ┆ str │
╞══════════╪═══════╪════════╪═════╡
b"hello" ┆ world ┆ b"!" ┆ :) │
└──────────┴───────┴────────┴─────┘
Select binary columns and export as a dict:
Expand Down

0 comments on commit e521fa6

Please sign in to comment.