This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
Conversation
This file contains 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
@zero323 would you be able to take a look? |
zero323
reviewed
May 14, 2021
third_party/3/pyspark/sql/column.pyi
Outdated
@@ -81,6 +81,7 @@ class Column: | |||
def alias(self, *alias: str, **kwargs: Any) -> Column: ... | |||
def name(self, *alias: str) -> Column: ... | |||
def cast(self, dataType: Union[DataType, str]) -> Column: ... | |||
def contains(self, other: Union[DataType, str]) -> Column: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep this consistent with upstream and have Any
here (see apache/spark#31823 (review))
Thank you for your proposal and sorry for a delayed response ‒ I am not much around here these days. |
Thanks @zero323, I've changed the type to |
zero323
approved these changes
May 19, 2021
zero323
pushed a commit
that referenced
this pull request
May 19, 2021
* added contains to Column * Made contains consistent with upstream * Remove accidentally union between DataType and Any Co-authored-by: Bram van den Akker <bram.vandenakker@booking.com>
Thanks @Braamling Merged into branch-2.4 and branch-3.0 |
@zero323 would it be possible to deploy this fix into the stubs for 2.4? We frequently run into this issue and would like to use the updates stubs :) |
Not a problem @Braamling Deployed to PyPi: I'll handle conda forge once bot prepares the PR. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The contains method is missing from the stubs causing mypy to raise
error: "Column" not callable
.This PR adds the typehints to 2.4 specifically (the version we are using), but it should probably also be added to the other versions.