Skip to content

Conversation

@jimexist
Copy link
Member

@jimexist jimexist commented Jul 22, 2021

Which issue does this PR close?

fix python binding for concat, concat_ws, and random

Closes #226

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

>>> import datafusion
>>> from datafusion import functions as f
>>> dir(f)
['__all__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'abs', 'acos', 'array', 'ascii', 'asin', 'atan', 'avg', 'bit_length', 'btrim', 'ceil', 'character_length', 'chr', 'col', 'concat', 'concat_ws', 'cos', 'count', 'exp', 'floor', 'in_list', 'initcap', 'left', 'lit', 'ln', 'log10', 'log2', 'lower', 'lpad', 'ltrim', 'max', 'md5', 'min', 'now', 'octet_length', 'random', 'regexp_replace', 'repeat', 'replace', 'reverse', 'right', 'round', 'rpad', 'rtrim', 'sha224', 'sha256', 'sha384', 'sha512', 'signum', 'sin', 'split_part', 'sqrt', 'starts_with', 'strpos', 'substr', 'sum', 'tan', 'to_hex', 'translate', 'trim', 'trunc', 'udaf', 'udf', 'upper']
>>> f.concat(f.lit(1), f.lit(2))
<builtins.Expression object at 0x1026fea30>
>>> f.concat(f.lit(1), f.lit(2), f.lit(3))
<builtins.Expression object at 0x1026feb70>

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jimexist -- I wonder if it would be helpful in the future to add a python level test for concat and concat_ws

@alamb alamb merged commit 2a4f94e into apache:master Jul 23, 2021
@jimexist jimexist deleted the fix-python branch July 24, 2021 00:56
@houqp houqp added the python label Jul 29, 2021
unkloud pushed a commit to unkloud/datafusion that referenced this pull request Mar 23, 2025
H0TB0X420 pushed a commit to H0TB0X420/datafusion that referenced this pull request Oct 7, 2025
* Small bugfix. When arguments are None, we should use count_star

* When no arguments are given to count, set argument to lit(1) so that it is similar to count_star but still enables you to select distinct=True.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concat from Dataframe API no longer accepts multiple expressions

3 participants