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-49894][PYTHON][CONNECT] Refine the string representation of column field operations #48369

Closed
wants to merge 3 commits into from

Conversation

zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Refine the string representation of column field operations: GetField, WithField, and DropFields

Why are the changes needed?

make the string representations consistent between pyspark classic and connect

Does this PR introduce any user-facing change?

yes

before

In [1]: from pyspark.sql import functions as sf

In [2]: c = sf.col("c")

In [3]: c.x
Out[3]: Column<'UnresolvedExtractValue(c, x)'>

after

In [1]: from pyspark.sql import functions as sf

In [2]: c = sf.col("c")

In [3]: c.x
Out[3]: Column<'c['x']'>

How was this patch tested?

added ut

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

no

@HyukjinKwon
Copy link
Member

Merged to master.

@zhengruifeng zhengruifeng deleted the py_connect_col_str branch October 8, 2024 01:38
himadripal pushed a commit to himadripal/spark that referenced this pull request Oct 19, 2024
…lumn field operations

### What changes were proposed in this pull request?
Refine the string representation of column field operations: `GetField`, `WithField`, and `DropFields`

### Why are the changes needed?
make the string representations consistent between pyspark classic and connect

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

before
```
In [1]: from pyspark.sql import functions as sf

In [2]: c = sf.col("c")

In [3]: c.x
Out[3]: Column<'UnresolvedExtractValue(c, x)'>
```

after
```
In [1]: from pyspark.sql import functions as sf

In [2]: c = sf.col("c")

In [3]: c.x
Out[3]: Column<'c['x']'>
```

### How was this patch tested?
added ut

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

Closes apache#48369 from zhengruifeng/py_connect_col_str.

Lead-authored-by: Ruifeng Zheng <ruifengz@apache.org>
Co-authored-by: Hyukjin Kwon <gurwls223@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants