Skip to content

Commit

Permalink
test(doctest): fix those tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Feb 3, 2024
1 parent 649bc8b commit 2ddb828
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
36 changes: 18 additions & 18 deletions ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,29 +547,29 @@ def isin(self, values: Value | Sequence[Value]) -> ir.BooleanValue:
Check against a derived expression
>>> t.a.isin(t.b + 1)
┏━━━━━━━━━━━━━━━━━━━━━━━━
InColumn(a, Add(b, 1)) ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━
│ boolean
├────────────────────────
│ False
│ False
│ True
└────────────────────────
┏━━━━━━━━━━━━━━━┓
InSubquery(a) ┃
┡━━━━━━━━━━━━━━━┩
│ boolean │
├───────────────┤
│ False │
│ False │
│ True │
└───────────────┘
Check against a column from a different table
>>> t2 = ibis.memtable({"x": [99, 2, 99]})
>>> t.a.isin(t2.x)
┏━━━━━━━━━━━━━━━
InColumn(a, x) ┃
┡━━━━━━━━━━━━━━━
│ boolean
├───────────────
│ False
│ True
│ False
└───────────────
┏━━━━━━━━━━━━━━━┓
InSubquery(a) ┃
┡━━━━━━━━━━━━━━━┩
│ boolean │
├───────────────┤
│ False │
│ True │
│ False │
└───────────────┘
"""
from ibis.expr.types import ArrayValue

Expand Down
22 changes: 11 additions & 11 deletions ibis/expr/types/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2947,17 +2947,17 @@ def join(
rated a movie:
>>> tags.join(ratings, ["userId", "movieId"]).head(5)
┏━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┓
┃ userId ┃ movieId ┃ tag ┃ timestamp ┃ rating ┃
┡━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━┩
│ int64 │ int64 │ string │ int64 │ float64 │
├────────┼─────────┼────────────────┼────────────┼─────────┤
62 2 │ Robin Williams │ 15288439074.0 │
62 110 │ sword fight │ 15281525354.5
62 410 │ gothic │ 15256366094.5
62 2023 │ mafia │ 15256367335.0 │
622124 │ quirky │ 15256368465.0 │
└────────┴─────────┴────────────────┴────────────┴─────────┘
┏━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┓
┃ userId ┃ movieId ┃ tag ┃ timestamp ┃ rating ┃
┡━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━┩
│ int64 │ int64 │ string │ int64 │ float64 │
├────────┼─────────┼────────────────┼────────────┼─────────┤
2 60756 │ will ferrell │ 14457149925.0 │
2 89774 │ Tom Hardy │ 14457152055.0
2 106782 │ Martin Scorsese │ 14457150565.0
7 48516 │ way too long │ 11696873251.0 │
18 431 │ mafia │ 14621387554.0 │
└────────┴─────────┴────────────────┴────────────┴─────────┘
To self-join a table with itself, you need to call
`.view()` on one of the arguments so the two tables
Expand Down
2 changes: 1 addition & 1 deletion ibis/expr/types/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ def join(self, strings: Sequence[str | StringValue] | ir.ArrayValue) -> StringVa
└──────────────────────┘
>>> ibis.literal("|").join(t.arr)
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ArrayStringJoin('|', arr) ┃
┃ ArrayStringJoin(arr, '|') ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ string │
├───────────────────────────┤
Expand Down

0 comments on commit 2ddb828

Please sign in to comment.