File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
docs/source/user-guide/dataframe Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -164,16 +164,17 @@ Note that ``column()`` is an alias of ``col()``, so you can use either name; the
164164
165165Whenever an argument represents an expression—such as in
166166:py:meth: `~datafusion.DataFrame.filter ` or
167- :py:meth: `~datafusion.DataFrame.with_column `—use ``col() `` to reference columns
168- and wrap constant values with ``lit() `` (also available as ``literal() ``):
167+ :py:meth: `~datafusion.DataFrame.with_column `—use ``col() `` to reference
168+ columns. The comparison and arithmetic operators on ``Expr `` will automatically
169+ convert any non-``Expr `` value into a literal expression, so writing
169170
170171.. code-block :: python
171172
172- from datafusion import col, lit
173- df.filter(col(' age' ) > lit( 21 ) )
173+ from datafusion import col
174+ df.filter(col(" age" ) > 21 )
174175
175- Without ``lit() `` DataFusion would treat `` 21 `` as a column name rather than a
176- constant value .
176+ is equivalent to using ``lit(21 ) `` explicitly. Use `` lit() `` (also available
177+ as `` literal() ``) when you need to construct a literal expression directly .
177178
178179Terminal Operations
179180-------------------
You can’t perform that action at this time.
0 commit comments