Skip to content

[MINOR][SQL][PYTHON][TEST] Add tests for dependent columns in withColumns - #58280

Closed
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:sql-py-withcolumns-dependent-tests-dev-1
Closed

[MINOR][SQL][PYTHON][TEST] Add tests for dependent columns in withColumns#58280
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:sql-py-withcolumns-dependent-tests-dev-1

Conversation

@zhengruifeng

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR adds direct regression coverage for dependent columns in DataFrame.withColumns.

The JVM test exercises the internal withColumns(Seq[String], Seq[Column]) overload. The PySpark test covers a multi-level dependency graph in both classic and Connect parity suites, plus a negative forward-reference case where the later column is otherwise valid.

Why are the changes needed?

Dependent columns currently work through lateral column alias resolution, but withColumns had no direct test guarding this behavior or its ordering constraint.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • ./build/sbt targeted DataFrameSuite test
  • Classic PySpark targeted DataFrameTests.test_with_columns_with_dependencies
  • Spark Connect targeted DataFrameParityTests.test_with_columns_with_dependencies

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

Generated-by: OpenAI Codex (GPT-5)

zhengruifeng added a commit that referenced this pull request Aug 26, 2026
…umns

### What changes were proposed in this pull request?

This PR adds direct regression coverage for dependent columns in `DataFrame.withColumns`.

The JVM test exercises the internal `withColumns(Seq[String], Seq[Column])` overload. The PySpark test covers a multi-level dependency graph in both classic and Connect parity suites, plus a negative forward-reference case where the later column is otherwise valid.

### Why are the changes needed?

Dependent columns currently work through lateral column alias resolution, but `withColumns` had no direct test guarding this behavior or its ordering constraint.

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

No.

### How was this patch tested?

- `./build/sbt` targeted `DataFrameSuite` test
- Classic PySpark targeted `DataFrameTests.test_with_columns_with_dependencies`
- Spark Connect targeted `DataFrameParityTests.test_with_columns_with_dependencies`

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

Generated-by: OpenAI Codex (GPT-5)

Closes #58280 from zhengruifeng/sql-py-withcolumns-dependent-tests-dev-1.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
(cherry picked from commit ed2a280)
Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
@zhengruifeng

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

@zhengruifeng
zhengruifeng deleted the sql-py-withcolumns-dependent-tests-dev-1 branch August 26, 2026 03:26
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.

2 participants