Skip to content

fix: Add .copy() to prevent SettingWithCopyWarning in histogram.py#37742

Closed
RamiNoodle733 wants to merge 1 commit intoapache:masterfrom
RamiNoodle733:fix-histogram-settingwithcopywarning-36530
Closed

fix: Add .copy() to prevent SettingWithCopyWarning in histogram.py#37742
RamiNoodle733 wants to merge 1 commit intoapache:masterfrom
RamiNoodle733:fix-histogram-settingwithcopywarning-36530

Conversation

@RamiNoodle733
Copy link

Fixes #36530

The df.dropna() returns a view which causes a Pandas SettingWithCopyWarning when modifying the column. Adding .copy() ensures we're working with a copy of the DataFrame.

Fixes apache#36530 - The df.dropna() returns a view which causes a Pandas
SettingWithCopyWarning when modifying the column. Adding .copy() ensures
we're working with a copy of the DataFrame.
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 6, 2026

Code Review Agent Run #1bea82

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 3f0ed85..3f0ed85
    • superset/utils/pandas_postprocessing/histogram.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

@dosubot dosubot bot added the change:backend Requires changing the backend label Feb 6, 2026
@sadpandajoe
Copy link
Member

closing since there are multiple PRs for this fix. It looks like the same pr may have been opened multiple times.

@sadpandajoe sadpandajoe closed this Feb 6, 2026
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.21%. Comparing base (9b861b2) to head (3f0ed85).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
superset/utils/pandas_postprocessing/histogram.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #37742       +/-   ##
===========================================
+ Coverage        0   66.21%   +66.21%     
===========================================
  Files           0      647      +647     
  Lines           0    49540    +49540     
  Branches        0     5568     +5568     
===========================================
+ Hits            0    32803    +32803     
- Misses          0    15435    +15435     
- Partials        0     1302     +1302     
Flag Coverage Δ
hive 41.73% <0.00%> (?)
mysql 64.28% <0.00%> (?)
postgres 64.36% <0.00%> (?)
presto 41.75% <0.00%> (?)
python 66.18% <0.00%> (?)
sqlite 64.05% <0.00%> (?)
unit 100.00% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 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

change:backend Requires changing the backend size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(low priority) Histogram throws warning in logs in 6.0.0rc4

2 participants