Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-47985][PYTHON] Simplify functions with lit #46219

Closed
wants to merge 1 commit into from

Conversation

zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Simplify functions with lit

Why are the changes needed?

code clean up, there are many such if-else in functions, which can be removed:

    if isinstance(json, Column):
        _json = json
    elif isinstance(json, str):
        _json = lit(json)

because lit function actually accepts the Column type input

Does this PR introduce any user-facing change?

no

How was this patch tested?

ci

Was this patch authored or co-authored using generative AI tooling?

no

@zhengruifeng zhengruifeng deleted the simplify_percentile branch April 25, 2024 12:57
@zhengruifeng
Copy link
Contributor Author

merged to master

JacobZheng0927 pushed a commit to JacobZheng0927/spark that referenced this pull request May 11, 2024
### What changes were proposed in this pull request?
Simplify functions with `lit`

### Why are the changes needed?
code clean up, there are many such `if-else` in functions, which can be removed:
```
    if isinstance(json, Column):
        _json = json
    elif isinstance(json, str):
        _json = lit(json)
```

because `lit` function actually accepts the Column type input

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
ci

### Was this patch authored or co-authored using generative AI tooling?
no

Closes apache#46219 from zhengruifeng/simplify_percentile.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants