Skip to content

[MINOR][PYTHON][DOCS] Add example to Column.outer docstring#57199

Open
CynicDog wants to merge 2 commits into
apache:masterfrom
CynicDog:column-outer-doc-examples
Open

[MINOR][PYTHON][DOCS] Add example to Column.outer docstring#57199
CynicDog wants to merge 2 commits into
apache:masterfrom
CynicDog:column-outer-doc-examples

Conversation

@CynicDog

@CynicDog CynicDog commented Jul 11, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Adds an Examples section to Column.outer()'s docstring in python/pyspark/sql/column.py. Every other Column method in this file has a worked example; outer() was the one exception.

The example builds a small employees DataFrame and uses .outer() inside a correlated scalar subquery to filter employees earning above their department's average salary.

Why are the changes needed?

outer() is easy to misunderstand from the description alone, since its effect (marking a column so it resolves against an outer query) only makes sense in the context of a correlated subquery. A concrete example makes that immediately clear, consistent with the rest of the file.

Does this PR introduce any user-facing change?

No. Documentation-only change (a docstring example).

How was this patch tested?

Built Spark locally (build/sbt -Phive package) and ran the Column.outer doctest directly against the built jars to confirm the example's output matches exactly.

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

Yes, co-authored. The code example and documentation text were authored by me, but I used Claude as a peer-review to validate the clarity of the example and check for edge cases before submission.

CynicDog added 2 commits July 11, 2026 20:58
Column.outer had no worked example showing how it's used to build a
correlated subquery, unlike the other Column methods in this file.
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.

1 participant