Repository: ibis-project/ibis

Issue:
docs: the range of admissible values for the seed argument of `Table.sample` is not documented
### Please describe the issue

I empirically tried with with the duckdb backend and found `[0, 2 ** 31 - 1]`. I have not checked if this is backend-specific or not.

Also, when using seeds outside of this range, the error message is cryptic:

<details>

```python
>>> import ibis
>>> ibis.options.interactive = True
>>> ibis.memtable({"a": range(10)}).sample(0.2, seed=2 ** 31)
Traceback (most recent call last):
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/IPython/core/formatters.py:974 in __call__
    return method(include=include, exclude=exclude)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/core.py:36 in _repr_mimebundle_
    bundle = super()._repr_mimebundle_(*args, **kwargs)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/rich/jupyter.py:48 in _repr_mimebundle_
    segments = list(console.render(self, console.options))
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/rich/console.py:1312 in render
    render_iterable = renderable.__rich_console__(self, _options)  # type: ignore[union-attr]
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/core.py:54 in __rich_console__
    return self.__interactive_rich_console__(console, options)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/relations.py:368 in __interactive_rich_console__
    table = to_rich_table(self, width)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/pretty.py:265 in to_rich_table
    result = table.limit(nrows + 1).to_pyarrow()
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/core.py:421 in to_pyarrow
    return self._find_backend(use_default=True).to_pyarrow(
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/backends/duckdb/__init__.py:1046 in to_pyarrow
    table = con.connection.sql(sql).to_arrow_table()
ParserException: Parser Error: syntax error at or near "2147483648"
LINE 2: ... t0_1 TABLESAMPLE bernoulli(20.0 PERCENT) REPEATABLE (2147483648) 
                                                  ^

Traceback (most recent call last):
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/IPython/core/formatters.py:699 in __call__
    return repr(obj)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/core.py:82 in __repr__
    simple_console.print(self)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/rich/console.py:1700 in print
    extend(render(renderable, render_options))
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/rich/console.py:1312 in render
    render_iterable = renderable.__rich_console__(self, _options)  # type: ignore[union-attr]
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/core.py:54 in __rich_console__
    return self.__interactive_rich_console__(console, options)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/relations.py:368 in __interactive_rich_console__
    table = to_rich_table(self, width)
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/pretty.py:265 in to_rich_table
    result = table.limit(nrows + 1).to_pyarrow()
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/expr/types/core.py:421 in to_pyarrow
    return self._find_backend(use_default=True).to_pyarrow(
  File ~/miniforge3/envs/dev/lib/python3.11/site-packages/ibis/backends/duckdb/__init__.py:1046 in to_pyarrow
    table = con.connection.sql(sql).to_arrow_table()
ParserException: Parser Error: syntax error at or near "2147483648"
LINE 2: ... t0_1 TABLESAMPLE bernoulli(20.0 PERCENT) REPEATABLE (2147483648)
```

</details>

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/ibis/expr/types/relations.py b/ibis/expr/types/relations.py
--- a/ibis/expr/types/relations.py
+++ b/ibis/expr/types/relations.py
@@ -1242,11 +1242,12 @@ def sample(
             correspond to "bernoulli" and "system" respectively in a
             TABLESAMPLE clause.
         seed
-            An optional random seed to use, for repeatable sampling. Backends
-            that never support specifying a seed for repeatable sampling will
-            error appropriately. Note that some backends (like DuckDB) do
-            support specifying a seed, but may still not have repeatable
-            results in all cases.
+            An optional random seed to use, for repeatable sampling. The range
+            of possible seed values is backend specific (most support at least
+            `[0, 2**31 - 1]`). Backends that never support specifying a seed
+            for repeatable sampling will error appropriately. Note that some
+            backends (like DuckDB) do support specifying a seed, but may still
+            not have repeatable results in all cases.
 
         Returns
         -------


Test patch: