Skip to content

fix(deps): restore np.nan in offset_metrics_df empty branch#41267

Open
eschutho wants to merge 1 commit into
apache:masterfrom
eschutho:fix/restore-np-nan-in-helpers
Open

fix(deps): restore np.nan in offset_metrics_df empty branch#41267
eschutho wants to merge 1 commit into
apache:masterfrom
eschutho:fix/restore-np-nan-in-helpers

Conversation

@eschutho

Copy link
Copy Markdown
Member

What was the problem?

PR #40421 (fix(sql): broaden mutating-statement detection) accidentally reverted the np.NaN → np.nan fix from PR #41118, reintroducing the deprecated alias in ExploreMixin.join_offset_dfs():

# helpers.py — offset_metrics_df empty branch
{
    col: [np.NaN]          # ← reverted by #40421
    for col in join_keys + list(metrics_mapping.values())
}

np.NaN was deprecated in NumPy 1.20 and removed in NumPy 2.0. The canonical spelling is np.nan.

Source: production Datadog logs showing DeprecationWarning: \np.NaN` was a deprecated alias`.

What changed?

Single-line fix: np.NaNnp.nan at superset/models/helpers.py:1982.

No behavior change — both are float('nan') / IEEE 754 NaN. np.nan is the correct, forward-compatible alias.

No-behavior-change note

np.nan and np.NaN are semantically identical on NumPy < 2.0. On NumPy ≥ 2.0, np.NaN raises AttributeError; this fix is strictly an improvement.

Test plan

  • Pre-commit hooks passed (auto-walrus, mypy, ruff, pylint)
  • grep -rn 'np\.NaN' superset/ --include='*.py' → zero results (no other occurrences in production code)
  • CI green

PR apache#40421 accidentally reverted the np.NaN→np.nan fix from apache#41118. np.NaN
was deprecated in NumPy 1.20 and removed in NumPy 2.0; this restores the
correct lowercase alias.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #87597c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 88844bc..88844bc
    • superset/models/helpers.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.36%. Comparing base (b612f57) to head (88844bc).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41267      +/-   ##
==========================================
- Coverage   64.36%   64.36%   -0.01%     
==========================================
  Files        2653     2653              
  Lines      144867   144867              
  Branches    33421    33421              
==========================================
- Hits        93250    93245       -5     
- Misses      49946    49949       +3     
- Partials     1671     1673       +2     
Flag Coverage Δ
hive 39.33% <ø> (ø)
mysql 58.05% <ø> (ø)
postgres 58.12% <ø> (-0.01%) ⬇️
presto 40.92% <ø> (ø)
python 59.56% <ø> (-0.01%) ⬇️
sqlite 57.78% <ø> (ø)
unit 100.00% <ø> (ø)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant