Add additional generic types to DataFrame methods #302
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.
Adding generic types to a few more methods beyond what was added in #293 by @scarf005
Focusing mostly on adding identity types to methods which I believe don’t change the original type of the dataframe. I added “identity” type signatures to the following methods:
These previously returned
DataFrame<any>
, even when called on a well-typed DataFrame, but now returnDataFrame<T>
(the original type)I also added better types for a few slightly more complex ones:
Along the way, I added minor fixes for the types of:
pl.intRange
[1] which had overloads in the wrong order leading to incorrect return types, andpl.Series(name, values, dtype)
constructor [2], whose strongly-typed overload was failing to apply in simple cases likepl.Series("index", [0, 1, 2, 3, 4], pl.Int64)
when the input array usednumber
s instead ofBigInt
s