Skip to content

[maintenance] Simplify wrap_output_data and fix transform_output guard#3248

Open
yuejiaointel wants to merge 1 commit into
uxlfoundation:mainfrom
yuejiaointel:cleanup/wrap-output-data
Open

[maintenance] Simplify wrap_output_data and fix transform_output guard#3248
yuejiaointel wants to merge 1 commit into
uxlfoundation:mainfrom
yuejiaointel:cleanup/wrap-output-data

Conversation

@yuejiaointel
Copy link
Copy Markdown
Contributor

The transform_output host-transfer block was duplicated across the array_api and non-array_api branches. Hoist it to a single early-return at the top of the wrapper.

Also drop the redundant transform_output in ("default", None) guard around the array-api result conversion. By the time control reached it, the earlier transform/fit_transform block had already returned for the non-default case, so the guard was either always True or incorrectly suppressed namespace conversion on predict/score paths when the user had set a global transform_output=polars/pandas.

Description


Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

The transform_output host-transfer block was duplicated across the
array_api and non-array_api branches. Hoist it to a single early-return
at the top of the wrapper.

Also drop the redundant `transform_output in ("default", None)` guard
around the array-api result conversion. By the time control reached it,
the earlier transform/fit_transform block had already returned for the
non-default case, so the guard was either always True or incorrectly
suppressed namespace conversion on predict/score paths when the user
had set a global transform_output=polars/pandas.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sklearnex/_device_offload.py 62.50% 5 Missing and 1 partial ⚠️
Flag Coverage Δ
azure 77.64% <62.50%> (+0.07%) ⬆️
github 71.70% <62.50%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sklearnex/_device_offload.py 82.75% <62.50%> (+0.53%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yuejiaointel
Copy link
Copy Markdown
Contributor Author

/intelci: run

@yuejiaointel yuejiaointel marked this pull request as ready for review June 4, 2026 17:52
Copilot AI review requested due to automatic review settings June 4, 2026 17:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants