Skip to content

[SPARK-42828][PYTHON][SQL] More explicit Python type annotations for GroupedData#40460

Closed
j03wang wants to merge 1 commit intoapache:masterfrom
j03wang:grouped-data-type
Closed

[SPARK-42828][PYTHON][SQL] More explicit Python type annotations for GroupedData#40460
j03wang wants to merge 1 commit intoapache:masterfrom
j03wang:grouped-data-type

Conversation

@j03wang
Copy link
Contributor

@j03wang j03wang commented Mar 16, 2023

What changes were proposed in this pull request?

Be more explicit in the Callable type annotation for dfapi and df_varargs_api to explicitly return a DataFrame.

Why are the changes needed?

In PySpark 3.3.x, type hints now infer the return value of something like df.groupBy(...).count() to be Any, whereas it should be DataFrame. This breaks type checking.

Does this PR introduce any user-facing change?

No

How was this patch tested?

No runtime changes introduced, so just relied on CI tests.

@j03wang
Copy link
Contributor Author

j03wang commented Mar 16, 2023

@ueshin who last touched the type hints

@j03wang j03wang changed the title [SPARK-42828] More explicit Python type annotations for GroupedData [SPARK-42828] [PYTHON] [SQL] More explicit Python type annotations for GroupedData Mar 16, 2023
@j03wang j03wang changed the title [SPARK-42828] [PYTHON] [SQL] More explicit Python type annotations for GroupedData [SPARK-42828][PYTHON][SQL] More explicit Python type annotations for GroupedData Mar 16, 2023
@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jun 25, 2023
@ueshin
Copy link
Member

ueshin commented Jun 25, 2023

@j03wang Sorry, I missed the ping.
Could you trigger the tests again by merging master or rebasing to master to check if the tests still pass?

cc @xinrong-meng Could you take a look?

@ueshin ueshin removed the Stale label Jun 25, 2023
@j03wang j03wang force-pushed the grouped-data-type branch from 12b6ae0 to e52efc4 Compare June 29, 2023 19:32
@j03wang j03wang force-pushed the grouped-data-type branch from e52efc4 to 0ad5664 Compare June 29, 2023 21:45
@xinrong-meng
Copy link
Member

Thanks for making the fix, LGTM!

@HyukjinKwon
Copy link
Member

Merged to master.

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.

4 participants

Comments