Skip to content

Update test case for numpy 2.4.6 - #40692

Merged
shunping merged 1 commit into
apache:masterfrom
jrmccluskey:numpyScalars
Oct 20, 2026
Merged

shunping merged 1 commit into
apache:masterfrom
jrmccluskey:numpyScalars

Conversation

@jrmccluskey

Copy link
Copy Markdown
Contributor

Numpy 2.4.6 does not allow for the conversion of 1-d arrays to scalars, which breaks this test case. Swaps to an explicit scalar which passes on all supported versions of numpy

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📋 Review Summary

This PR updates BaseMLTransformTest.test_ml_transform_dict_output_pcoll_schema in base_test.py to use explicit NumPy scalar types (np.int64(1) and np.float32(2.0)) instead of 1-D single-element arrays. This resolves a compatibility issue with NumPy 2.4.6+ where implicit conversion of 1-D arrays to scalars is disallowed when matching the scalar input_types schema.

🔍 General Feedback

  • The change is clean, minimal, and accurately aligns the test input data with the declared scalar input_types (np.int32 and np.float32).

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.02%. Comparing base (76f6e6d) to head (a310f55).
⚠️ Report is 250 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40692       +/-   ##
=============================================
+ Coverage     56.16%   80.02%   +23.85%     
=============================================
  Files          1124      490      -634     
  Lines        178336    82818    -95518     
  Branches       1489        0     -1489     
=============================================
- Hits         100170    66274    -33896     
+ Misses        75645    16544    -59101     
+ Partials       2521        0     -2521     
Flag Coverage Δ
go ?
java ?
python 80.02% <ø> (+0.46%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @shunping for label python.
Backup reviewer: damccorm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@shunping shunping left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lgtm, thanks!

@shunping
shunping merged commit f014f5a into apache:master Oct 20, 2026
86 of 87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants