-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional generic types to DataFrame methods (#302)
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: > extend, fillNull, filter, interpolate, limit, max, mean, median, min, quantile, rechunk, shiftAndFill, shrinkToFit, slice, sort, std, sum, tail, unique, var, vstack, where, upsample These previously returned `DataFrame<any>`, even when called on a well-typed DataFrame, but now return `DataFrame<T>` (the original type) --- I also added better types for a few slightly more complex ones: - map - improved return type based on the function passed, but unimproved parameter type - nullCount - toRecords - toSeries - for now, returning a broad union type, rather than identifying the specific column by index - withColumn --- Along the way, I added minor fixes for the types of: 1. `pl.intRange` [[1]](890bf21) which had overloads in the wrong order leading to incorrect return types, and 2. the `pl.Series(name, values, dtype)` constructor [[2]](a2635bd), whose strongly-typed overload was failing to apply in simple cases like `pl.Series("index", [0, 1, 2, 3, 4], pl.Int64)` when the input array used `number`s instead of `BigInt`s
- Loading branch information
1 parent
62a70dc
commit 8816b46
Showing
5 changed files
with
108 additions
and
65 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.