MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / tablesample

Method tablesample

lib/sqlalchemy/sql/selectable.py:827–846  ·  view source on GitHub ↗

Return a TABLESAMPLE alias of this :class:`_expression.FromClause`. The return value is the :class:`_expression.TableSample` construct also provided by the top-level :func:`_expression.tablesample` function. .. seealso:: :func:`_expression.tablesample`

(
        self,
        sampling: Union[float, Function[Any]],
        name: Optional[str] = None,
        seed: Optional[roles.ExpressionElementRole[Any]] = None,
    )

Source from the content-addressed store, hash-verified

825 return Alias._construct(self, name=name)
826
827 def tablesample(
828 self,
829 sampling: Union[float, Function[Any]],
830 name: Optional[str] = None,
831 seed: Optional[roles.ExpressionElementRole[Any]] = None,
832 ) -> TableSample:
833 """Return a TABLESAMPLE alias of this :class:`_expression.FromClause`.
834
835 The return value is the :class:`_expression.TableSample`
836 construct also
837 provided by the top-level :func:`_expression.tablesample` function.
838
839 .. seealso::
840
841 :func:`_expression.tablesample` - usage guidelines and parameters
842
843 """
844 return TableSample._construct(
845 self, sampling=sampling, name=name, seed=seed
846 )
847
848 def is_derived_from(self, fromclause: Optional[FromClause]) -> bool:
849 """Return ``True`` if this :class:`_expression.FromClause` is

Callers 4

_factoryMethod · 0.80
CoreFixturesClass · 0.80
test_standaloneMethod · 0.80
test_select_fromMethod · 0.80

Calls 1

_constructMethod · 0.45

Tested by 2

test_standaloneMethod · 0.64
test_select_fromMethod · 0.64