[MINOR][SQL][PYTHON][TEST] Add tests for dependent columns in withColumns - #58280
Closed
zhengruifeng wants to merge 1 commit into
Closed
[MINOR][SQL][PYTHON][TEST] Add tests for dependent columns in withColumns#58280zhengruifeng wants to merge 1 commit into
zhengruifeng wants to merge 1 commit into
Conversation
HyukjinKwon
approved these changes
Aug 26, 2026
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>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
withColumnshad 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/sbttargetedDataFrameSuitetestDataFrameTests.test_with_columns_with_dependenciesDataFrameParityTests.test_with_columns_with_dependenciesWas this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)