Skip to content

Commit bd0f57e

Browse files
committed
docs: clarify usage of datafusion.col and datafusion.lit in DataFrame method documentation
1 parent 992d619 commit bd0f57e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

python/datafusion/dataframe.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ def filter(self, *predicates: Expr) -> DataFrame:
421421
out. If more than one predicate is provided, these predicates will be
422422
combined as a logical AND. Each ``predicate`` must be an
423423
:class:`~datafusion.expr.Expr` created using helper functions such as
424+
:func:`datafusion.col` or :func:`datafusion.lit`.
425+
If more complex logic is required, see the logical operations in
426+
:py:mod:`~datafusion.functions`.
424427
425428
Example::
426429
@@ -442,7 +445,7 @@ def with_column(self, name: str, expr: Expr) -> DataFrame:
442445
"""Add an additional column to the DataFrame.
443446
444447
The ``expr`` must be an :class:`~datafusion.expr.Expr` constructed with
445-
accepted.
448+
:func:`datafusion.col` or :func:`datafusion.lit`.
446449
447450
Example::
448451
@@ -465,7 +468,8 @@ def with_columns(
465468
466469
By passing expressions, iterables of expressions, or named expressions.
467470
All expressions must be :class:`~datafusion.expr.Expr` objects created via
468-
accepted. To pass named expressions use the form ``name=Expr``.
471+
:func:`datafusion.col` or :func:`datafusion.lit`.
472+
To pass named expressions use the form ``name=Expr``.
469473
470474
Example usage: The following will add 4 columns labeled ``a``, ``b``, ``c``,
471475
and ``d``::
@@ -762,9 +766,8 @@ def join_on(
762766
"""Join two :py:class:`DataFrame` using the specified expressions.
763767
764768
Join predicates must be :class:`~datafusion.expr.Expr` objects, typically
765-
built with :func:`datafusion.col`; On
766-
expressions are used to support in-equality predicates. Equality predicates
767-
are correctly optimized.
769+
built with :func:`datafusion.col`. On expressions are used to support
770+
in-equality predicates. Equality predicates are correctly optimized.
768771
769772
Example::
770773

0 commit comments

Comments
 (0)