Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Overload DataFrame.drop: sequences must be *str #377

Merged
merged 2 commits into from Feb 17, 2020

Conversation

oliverw1
Copy link
Contributor

@oliverw1 oliverw1 commented Feb 17, 2020

The method DataFrame.drop expects either 1 Column, or 1 str, or an iterable of strings. This is only type checked inside the function though.

Currently the type hints (and the actual API) allow to pass multiple Columns but it does result in a runtime error. Personally, I'd like to have that caught earlier. But as this might be getting too close to the internals of the functions, I’d like to hear your opinion on whether or not the type hints should “look inside” to aid development.

@zero323
Copy link
Owner

zero323 commented Feb 17, 2020

Nice catch.

I thought we might resolve it upstream, but this would require an additional signature in Scala, and it might be a hard to sell.

@oliverw1
Copy link
Contributor Author

Well, you carry more weight in the Spark development circles, but I think you're right. It’s a nice to have. With this PR, I’m hoping it eases development for some. Thanks for the review, zero323!

@zero323 zero323 merged commit 7d95746 into zero323:master Feb 17, 2020
@zero323
Copy link
Owner

zero323 commented Feb 17, 2020

Well, you carry more weight in the Spark development circles, but I think you're right

I seriously doubt that :)

zero323 pushed a commit that referenced this pull request Feb 17, 2020
* Overload DataFrame.drop: sequences must be *str
@zero323
Copy link
Owner

zero323 commented Feb 17, 2020

Merged into master, backported to 2.4. Thanks your work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants