Repository navigation
Conversation
… calendar labels - Box plot: count observations with Series.count so NULL metric values are left out of `__count` (np.ma.count counted every row). - Pivot table totals: assign the placeholder replacement back to the column; under copy-on-write the chained inplace replace never reached the frame, so a missing non-numeric cell exported as a blank instead of "nan". - Calendar heatmap: leave the value label empty on days without data rather than rendering a literal "null". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45865 +/- ##
=======================================
Coverage 84.70% 84.71%
=======================================
Files 3069 3069
Lines 205649 205663 +14
Branches 48335 48336 +1
=======================================
+ Hits 174200 174222 +22
+ Misses 28156 28148 -8
Partials 3293 3293
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
EnxDev
left a comment
There was a problem hiding this comment.
Read through this one and the three fixes hold up. The tests reproduce each bug, and CI is green.
One optional note inline about the same count bug in the shared aggregate map.
| whisker_high = np.max | ||
| whisker_low = np.min | ||
|
|
||
| def count(series: Series) -> int: |
There was a problem hiding this comment.
Nit, take it or leave it. NUMPY_FUNCTIONS["count"] in pandas_postprocessing/utils.py:35 is still np.ma.count, so an aggregate or pivot step with operator: "count" keeps counting NULL rows the same way.
Same swap would fix it there too. Fine as a follow-up if you'd rather keep this PR tight.
SUMMARY
Fixes three issues from a pandas 3.0 chart smoke test:
__countcounted NULL values.np.ma.counton a plain array counts every element, so rows whose metric is NULL were counted, and a group with only NULLs counted its row total. This happens on pandas 2 as well. The count usesSeries.count, which leaves NULLs out.nan. Inpivot_df,df[col].replace("SUPERSET_PANDAS_NAN", ..., inplace=True)is a chained inplace call. Under pandas 3 copy-on-write it only updates a copy (pandas raisesChainedAssignmentErrorfor it), so the"nan"text for missing cells in non-numeric metric columns never reached the frame. The later frame-wide replace turned those cells intonp.nan, which a CSV writes as empty. The result is now assigned back to the column. Totals values were already correct.nullon days with no data. cal-heatmap passesnullfor those days, and the number formatter renders it as"null". The label is empty for missing values.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not captured. The calendar change only affects days without data when "Show Values" is on: before, the cell read
null; after, it is empty.TESTING INSTRUCTIONS
test_boxplot_count_excludes_null_metric_values. It fails on master (counts{a: 3, b: 2}instead of{a: 2, b: 0}) under both pandas 2.3.3 and 3.0.6, and passes with the fix.test_pivot_df_rows_total_keeps_nan_text_in_non_numeric_metric. It fails on master under pandas 3.0.6 (nan == 'nan') and passes with the fix.tests/unit_tests/charts/also passes with-W error::pandas.errors.ChainedAssignmentError.Calendar value labels leave days without data blanktest inReactCalendar.test.tsx. It fails on master ("null") and passes with the fix.Manual check: build a calendar heatmap with "Show Values" on over a range with gaps. Empty days should carry no label.
ADDITIONAL INFORMATION
🤖 Generated with Claude Code