Skip to content

Commit

Permalink
chore(deps): bump duckdb to 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Feb 6, 2025
1 parent eda91b2 commit 440460e
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 78 deletions.
13 changes: 1 addition & 12 deletions ibis/backends/duckdb/tests/test_geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,7 @@ def no_roundtrip(
reason="duckdb can't write this because it doesn't expose GDAL's dataset creation options"
),
),
param(
"ODS",
"ods",
{},
lambda t: t.mutate(geom=t.geom.as_text()),
marks=pytest.mark.xfail(
condition=WINDOWS,
raises=duckdb.IOException,
reason="not working on windows",
),
id="ods",
),
param("ODS", "ods", {}, lambda t: t.mutate(geom=t.geom.as_text()), id="ods"),
param("XLSX", "xlsx", {}, lambda t: t.mutate(geom=t.geom.as_text()), id="xlsx"),
param(
"Selafin",
Expand Down
18 changes: 9 additions & 9 deletions ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ def aggregate(
... total_cost=_.price.sum(),
... avg_cost=_.price.mean(),
... having=_.price.sum() < 0.5,
... )
... ).order_by("fruit")
┏━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ fruit ┃ total_cost ┃ avg_cost ┃
┡━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━┩
Expand Down Expand Up @@ -3137,17 +3137,17 @@ def join(
sequence. Find all instances where a user both tagged and
rated a movie:
>>> tags.join(ratings, ["userId", "movieId"]).head(5).order_by("userId")
>>> tags.join(ratings, ["userId", "movieId"]).head(5).order_by("userId", "movieId")
┏━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┓
┃ userId ┃ movieId ┃ tag ┃ timestamp ┃ rating ┃
┡━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━┩
│ int64 │ int64 │ string │ int64 │ float64 │
├────────┼─────────┼────────────────┼────────────┼─────────┤
│ 62 │ 2 │ Robin Williams │ 1528843907 │ 4.0 │
│ 62 │ 110 │ sword fight │ 1528152535 │ 4.5 │
│ 62 │ 410 │ gothic │ 1525636609 │ 4.5 │
│ 62 │ 2023 │ mafia │ 1525636733 │ 5.0 │
│ 62 │ 2124 │ quirky │ 1525636846 │ 5.0 │
│ 62 │ 2953 │ sequel │ 1525636887 │ 3.5 │
│ 62 │ 3114 │ Tom Hanks │ 1525636925 │ 3.0 │
└────────┴─────────┴────────────────┴────────────┴─────────┘
To self-join a table with itself, you need to call
Expand Down Expand Up @@ -4819,7 +4819,7 @@ def unnest(
Unnest the array column `x`, replacing the **existing** `x` column.
>>> t.unnest("x")
>>> t.unnest("x").order_by(_.x)
┏━━━━━━━┳━━━━━━━┓
┃ x ┃ y ┃
┡━━━━━━━╇━━━━━━━┩
Expand All @@ -4835,7 +4835,7 @@ def unnest(
Unnest the array column `x` with an offset. The `offset` parameter is
the name of the resulting index column.
>>> t.unnest(t.x, offset="idx")
>>> t.unnest(t.x, offset="idx").order_by(_.x)
┏━━━━━━━┳━━━━━━━┳━━━━━━━┓
┃ x ┃ y ┃ idx ┃
┡━━━━━━━╇━━━━━━━╇━━━━━━━┩
Expand All @@ -4851,7 +4851,7 @@ def unnest(
Unnest the array column `x` keep empty array values as `NULL` in the
output table.
>>> t.unnest(_.x, offset="idx", keep_empty=True)
>>> t.unnest(_.x, offset="idx", keep_empty=True).order_by(_.x, _.y)
┏━━━━━━━┳━━━━━━━┳━━━━━━━┓
┃ x ┃ y ┃ idx ┃
┡━━━━━━━╇━━━━━━━╇━━━━━━━┩
Expand All @@ -4875,7 +4875,7 @@ def unnest(
... t.mutate(original_row=ibis.row_number())
... .unnest("x", offset="idx", keep_empty=True)
... .relocate("original_row")
... .order_by("original_row")
... .order_by("original_row", "idx")
... )
┏━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓
┃ original_row ┃ x ┃ y ┃ idx ┃
Expand All @@ -4894,7 +4894,7 @@ def unnest(
You can also unnest more complex expressions, and the resulting column
will be projected as the last expression in the result.
>>> t.unnest(_.x.map(lambda v: v + 1).name("plus_one"))
>>> t.unnest(_.x.map(lambda v: v + 1).name("plus_one")).order_by(_.plus_one)
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┓
┃ x ┃ y ┃ plus_one ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━┩
Expand Down
39 changes: 19 additions & 20 deletions ibis/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def if_any(selector: Selector, predicate: Deferred | Callable) -> IfAnyAll:
>>> import ibis
>>> from ibis import selectors as s, _
>>> ibis.options.interactive = True
>>> penguins = ibis.examples.penguins.fetch()
>>> penguins = ibis.examples.penguins.fetch().mutate(idx=ibis.row_number().over())
>>> cols = s.across(s.endswith("_mm"), (_ - _.mean()) / _.std())
>>> expr = penguins.mutate(cols).filter(s.if_any(s.endswith("_mm"), _.abs() > 2))
>>> expr_by_hand = penguins.mutate(cols).filter(
Expand All @@ -590,25 +590,24 @@ def if_any(selector: Selector, predicate: Deferred | Callable) -> IfAnyAll:
... )
>>> expr.equals(expr_by_hand)
True
>>> expr
┏━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━┓
┃ species ┃ island ┃ bill_length_mm ┃ bill_depth_mm ┃ flipper_length_mm ┃ … ┃
┡━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━┩
│ string │ string │ float64 │ float64 │ float64 │ … │
├─────────┼────────┼────────────────┼───────────────┼───────────────────┼───┤
│ Adelie │ Biscoe │ -1.103002 │ 0.733662 │ -2.056307 │ … │
│ Gentoo │ Biscoe │ 1.113285 │ -0.431017 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ 2.871660 │ -0.076550 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ 1.900890 │ -0.734846 │ 2.139483 │ … │
│ Gentoo │ Biscoe │ 1.076652 │ -0.177826 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ 0.856855 │ -0.582932 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ 1.497929 │ -0.076550 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ 1.388031 │ -0.431017 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ 2.047422 │ -0.582932 │ 2.068368 │ … │
│ Adelie │ Dream │ -2.165354 │ -0.836123 │ -0.918466 │ … │
│ … │ … │ … │ … │ … │ … │
└─────────┴────────┴────────────────┴───────────────┴───────────────────┴───┘
>>> expr.order_by(_.idx)
┏━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━┓
┃ species ┃ island ┃ bill_length_mm ┃ bill_depth_mm ┃ flipper_length_mm ┃ … ┃
┡━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━┩
│ string │ string │ float64 │ float64 │ float64 │ … │
├─────────┼───────────┼────────────────┼───────────────┼───────────────────┼───┤
│ Adelie │ Torgersen │ -0.974787 │ 2.050255 │ -0.705121 │ … │
│ Adelie │ Torgersen │ 0.380628 │ 2.202170 │ -0.491775 │ … │
│ Adelie │ Biscoe │ -1.103002 │ 0.733662 │ -2.056307 │ … │
│ Adelie │ Dream │ -0.297079 │ 2.050255 │ -0.705121 │ … │
│ Adelie │ Dream │ -2.165354 │ -0.836123 │ -0.918466 │ … │
│ Gentoo │ Biscoe │ 0.398944 │ -2.000802 │ 0.717181 │ … │
│ Gentoo │ Biscoe │ 1.113285 │ -0.431017 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ -0.187181 │ -2.051440 │ 1.001641 │ … │
│ Gentoo │ Biscoe │ 2.871660 │ -0.076550 │ 2.068368 │ … │
│ Gentoo │ Biscoe │ 1.900890 │ -0.734846 │ 2.139483 │ … │
│ … │ … │ … │ … │ … │ … │
└─────────┴───────────┴────────────────┴───────────────┴───────────────────┴───┘
"""
return IfAnyAll(selector=selector, predicate=predicate, summarizer=operator.or_)

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 440460e

Please sign in to comment.