Skip to content

Commit

Permalink
docs: add callout notes for some APIs changes and additions
Browse files Browse the repository at this point in the history
fixes #10535
  • Loading branch information
NickCrews authored and cpcloud committed Dec 21, 2024
1 parent 573a995 commit 529a8cb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,15 @@ def do_connect(
) -> None:
"""Create an Ibis client connected to a DuckDB database.
::: {.callout-note title="Changed in version 10.0.0"}
Before, we had special handling if the user passed the `temp_directory`
parameter, setting a custom default, and creating intermediate
directories if necessary. Now, we do nothing, and just pass the value
directly to DuckDB. You may need to add
`Path(your_temp_dir).mkdir(exists_ok=True, parents=True)`
to your code to maintain the old behavior.
:::
Parameters
----------
database
Expand All @@ -383,6 +392,7 @@ def do_connect(
>>> import ibis
>>> ibis.duckdb.connect(threads=4, memory_limit="1GB") # doctest: +ELLIPSIS
<ibis.backends.duckdb.Backend object at 0x...>
"""
if not isinstance(database, Path) and not database.startswith(
("md:", "motherduck:", ":memory:")
Expand Down
3 changes: 3 additions & 0 deletions ibis/expr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,9 @@ def cases(
Equivalent to a SQL `CASE` statement.
::: {.callout-note title="Added in version 10.0.0"}
:::
Parameters
----------
branch
Expand Down
10 changes: 10 additions & 0 deletions ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,9 @@ def topk(
Computes a Table containing the top `k` values by a certain metric
(defaults to count).
::: {.callout-note title="Changed in version 9.5.0"}
Added `name` parameter.
Parameters
----------
k
Expand Down Expand Up @@ -2122,6 +2125,7 @@ def topk(
│ J │ 5.01 │
│ H │ 4.13 │
└────────┴───────────┘
:::
"""
from ibis.expr.types.relations import bind

Expand Down Expand Up @@ -2268,6 +2272,9 @@ def value_counts(self, *, name: str | None = None) -> ir.Table:
│ c │ 3 │
│ d │ 4 │
└────────┴───────┘
::: {.callout-note title="Added in version 9.5.0"}
:::
"""
colname = self.get_name()
if name is None:
Expand Down Expand Up @@ -2774,6 +2781,9 @@ def to_list(self, **kwargs) -> list:
>>> t = ibis.examples.penguins.fetch()
>>> t.bill_length_mm.to_list(limit=5)
[39.1, 39.5, 40.3, None, 36.7]
::: {.callout-note title="Added in version 10.0.0"}
:::
"""
return self.to_pyarrow(**kwargs).to_pylist()

Expand Down
4 changes: 4 additions & 0 deletions ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4688,6 +4688,10 @@ def window_by(
def value_counts(self, *, name: str | None = None) -> ir.Table:
"""Compute a frequency table of this table's values.
::: {.callout-note title="Changed in version 10.0.0"}
Added `name` parameter.
:::
Parameters
----------
name
Expand Down

0 comments on commit 529a8cb

Please sign in to comment.