-
Notifications
You must be signed in to change notification settings - Fork 172
feat: Add Series.from_iterable
#2933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
2afc8c8
feat: Add `Series.from_iterable`
dangotbanned ba7a983
feat: Add to `v1`, `v2`
dangotbanned 4841d9a
docs: Adapt `Series.from_numpy`
dangotbanned 5c28080
test: Port `new_series` tests
dangotbanned fdc108b
test: cover failure cases
dangotbanned d939ef7
docs: Add to api reference
dangotbanned 02ab3cb
test: cover `v1`, `v2`
dangotbanned 1cfcafb
test: don't rely on `pandas` supporting `[us]`
dangotbanned 2a9ac28
test: xfail pandas `[ms]`
dangotbanned b6e2895
Merge branch 'main' into series-from-iterable
dangotbanned 2137178
Merge remote-tracking branch 'upstream/main' into series-from-iterable
dangotbanned 28da5a0
refactor: fix `RET505`
dangotbanned 7fd179c
test: Split out infer case
dangotbanned efc5c4e
test: Check lots of iterables
dangotbanned 328ecf0
test(DRAFT): xfail `polars` w/ `pd.array`, todo `pyarrow` fix
dangotbanned 3f13379
fix: Ensure `cast` occurs before `pa.chunked_array` call
dangotbanned bd2a084
test: Cover other data types
dangotbanned 48cf17b
fix: Try downcasting in `polars`
dangotbanned 9bfd3c4
cov plz
dangotbanned c666872
fix: backport `pd.Index` support
dangotbanned 4a27299
cov
dangotbanned f1feba7
test: xfail pandas nightly string polars
dangotbanned 2b70b18
test: Simplify test ids
dangotbanned f7ab46f
Merge branch 'main' into series-from-iterable
dangotbanned f965e98
Merge branch 'main' into series-from-iterable
dangotbanned 4646051
test: just skip this nonsense
dangotbanned 58f093a
Merge branch 'main' into series-from-iterable
dangotbanned dc78c53
Merge branch 'main' into series-from-iterable
dangotbanned 8b1fdc6
Merge branch 'main' into series-from-iterable
dangotbanned c206b8f
Merge branch 'main' into series-from-iterable
dangotbanned 48cb0b3
Merge branch 'main' into series-from-iterable
dangotbanned ebfeb1b
Merge branch 'main' into series-from-iterable
dangotbanned 773fcbb
Merge branch 'main' into series-from-iterable
dangotbanned cd98af6
revert: try *not* downcasting polars
dangotbanned 4400166
fix: backport respect `dtype`, optimize branching
dangotbanned f73a2f9
Merge remote-tracking branch 'upstream/main' into series-from-iterable
dangotbanned f0d1a4f
Merge branch 'main' into series-from-iterable
dangotbanned 3fc9e06
Merge branch 'main' into series-from-iterable
dangotbanned 8b31c92
Merge branch 'main' into series-from-iterable
dangotbanned a30f54f
Merge branch 'main' into series-from-iterable
dangotbanned File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ | |
| - exp | ||
| - fill_null | ||
| - filter | ||
| - from_iterable | ||
| - from_numpy | ||
| - gather_every | ||
| - head | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,6 +189,8 @@ def collect( | |
|
|
||
|
|
||
| class Series(NwSeries[IntoSeriesT]): | ||
| _version = Version.V2 | ||
|
|
||
| @inherit_doc(NwSeries) | ||
| def __init__( | ||
| self, series: Any, *, level: Literal["full", "lazy", "interchange"] | ||
|
|
@@ -203,6 +205,20 @@ def __init__( | |
| def _dataframe(self) -> type[DataFrame[Any]]: | ||
| return DataFrame | ||
|
|
||
| # TODO @dangotbanned: Fix `from_numpy` override missing in `v2` in another PR | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note
|
||
|
|
||
| @classmethod | ||
| def from_iterable( | ||
| cls, | ||
| name: str, | ||
| values: Iterable[Any], | ||
| dtype: IntoDType | None = None, | ||
| *, | ||
| backend: ModuleType | Implementation | str, | ||
| ) -> Series[Any]: | ||
| result = super().from_iterable(name, values, dtype, backend=backend) | ||
| return cast("Series[Any]", result) | ||
|
|
||
| def to_frame(self) -> DataFrame[Any]: | ||
| return _stableify(super().to_frame()) | ||
|
|
||
|
|
||
This file contains hidden or 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.
Oops, something went wrong.
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.
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.
Oh boy π©
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 tried something new here when thinking about (#2933 (comment)), which might not be visible from the diff alone