Skip to content

Commit

Permalink
docs: add missing import to RowNumber example (#8523)
Browse files Browse the repository at this point in the history
## Description of changes

The existing example was not self-contained. Upon execution, it raised
an error as `dt.int64` could not be resolved.

```python
>>> import ibis
>>> t = ibis.table([("values", dt.int64)])  # NameError: name 'dt' is not defined
>>> w = ibis.window(order_by=t.values)
>>> row_num = ibis.row_number().over(w)
>>> result = t[t.values, row_num.name("row_num")]
```

This PR adds the missing `import ibis.expr.datatypes as dt` statement.
  • Loading branch information
peter-gy authored Mar 2, 2024
1 parent b853285 commit ba21ec0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ibis/expr/operations/analytic.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class RowNumber(RankBase):
Examples
--------
>>> import ibis
>>> import ibis.expr.datatypes as dt
>>> t = ibis.table([("values", dt.int64)])
>>> w = ibis.window(order_by=t.values)
>>> row_num = ibis.row_number().over(w)
Expand Down

0 comments on commit ba21ec0

Please sign in to comment.