FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

BUG: Fix Results.to_dataframe() for scalar outputs with __getitem__ by basnijholt · Pull Request #925 · pipefunc/pipefunc · GitHub

BUG: Fix Results.to_dataframe() for scalar outputs with __getitem__ - #925

Merged
basnijholt merged 2 commits into
mainfrom
fix/scalar-getitem-to-dataframe
Dec 3, 2025
Merged

BUG: Fix Results.to_dataframe() for scalar outputs with __getitem__#925
basnijholt merged 2 commits into
mainfrom
fix/scalar-getitem-to-dataframe

Conversation

Copy link
Copy Markdown
Collaborator

Summary

  • Fix Results.to_dataframe() failing when a pipeline has a scalar (non-mapped) output that implements __getitem__
  • Create 0-D object arrays by allocating with np.empty((), dtype=object) and assigning directly, preventing numpy from iterating over indexable objects

Test plan

Fixes #924

When a pipeline has a scalar (non-mapped) output that implements
__getitem__, to_dataframe() fails because numpy iterates over the
object when creating an array, producing unexpected shapes.

See: #924
Create a 0-D object array by first allocating an empty array and then
assigning the value. This prevents numpy from iterating over objects
that implement __getitem__, which would produce unexpected array shapes.

Fixes: #924

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR has been updated to match the correct format. Thank you!

codecov Bot commented Dec 2, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
pipefunc/map/xarray.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codspeed-hq Bot commented Dec 2, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #925 will not alter performance

Comparing fix/scalar-getitem-to-dataframe (d2a728d) with main (76991bc)

Summary

✅ 6 untouched

basnijholt merged commit 988c4f4 into main Dec 3, 2025
21 checks passed
basnijholt deleted the fix/scalar-getitem-to-dataframe branch December 3, 2025 14:50
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Results.to_dataframe() fails for scalar outputs with __getitem__

1 participant


Back | FazBrowse Home | New Git URL