Skip to content

Fix pandas FutureWarning in Data.deduplicate for groupby operations (#5069)#5069

Closed
eytan wants to merge 1 commit intofacebook:mainfrom
eytan:export-D97020436
Closed

Fix pandas FutureWarning in Data.deduplicate for groupby operations (#5069)#5069
eytan wants to merge 1 commit intofacebook:mainfrom
eytan:export-D97020436

Conversation

@eytan
Copy link
Contributor

@eytan eytan commented Mar 19, 2026

Summary:

Fixes a pandas FutureWarning that appears when using DataFrameGroupBy.apply on grouping columns by changing to SeriesGroupBy.apply. The fix adds [MAP_KEY] selector before .apply() at line 360 in ax/core/data.py, which operates on the series rather than the entire grouped DataFrame. This eliminates the deprecation warning on pandas >= 2.1 while maintaining backward compatibility with older pandas versions.

--
Reviewed + modified AI generated Summary & Test Plan from DEV115723120

Reviewed By: saitcakmak

Differential Revision: D97020436

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 19, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 19, 2026

@eytan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97020436.

@meta-codesync meta-codesync bot changed the title Fix pandas FutureWarning in Data.deduplicate for groupby operations Fix pandas FutureWarning in Data.deduplicate for groupby operations (#5069) Mar 19, 2026
eytan pushed a commit to eytan/Ax-1 that referenced this pull request Mar 19, 2026
…acebook#5069)

Summary:

Fixes a pandas FutureWarning that appears when using `DataFrameGroupBy.apply` on grouping columns by changing to `SeriesGroupBy.apply`. The fix adds `[MAP_KEY]` selector before `.apply()` at line 360 in `ax/core/data.py`, which operates on the series rather than the entire grouped DataFrame. This eliminates the deprecation warning on pandas >= 2.1 while maintaining backward compatibility with older pandas versions.

--
Reviewed + modified AI generated Summary & Test Plan from DEV115723120

Reviewed By: saitcakmak

Differential Revision: D97020436
@eytan eytan force-pushed the export-D97020436 branch from 9283784 to a84b363 Compare March 19, 2026 15:23
eytan pushed a commit to eytan/Ax-1 that referenced this pull request Mar 19, 2026
…acebook#5069)

Summary:
Pull Request resolved: facebook#5069

Fixes a pandas FutureWarning that appears when using `DataFrameGroupBy.apply` on grouping columns by changing to `SeriesGroupBy.apply`. The fix adds `[MAP_KEY]` selector before `.apply()` at line 360 in `ax/core/data.py`, which operates on the series rather than the entire grouped DataFrame. This eliminates the deprecation warning on pandas >= 2.1 while maintaining backward compatibility with older pandas versions.

--
Reviewed + modified AI generated Summary & Test Plan from DEV115723120

Reviewed By: saitcakmak

Differential Revision: D97020436
@eytan eytan force-pushed the export-D97020436 branch from a84b363 to b65893e Compare March 19, 2026 15:26
eytan pushed a commit to eytan/Ax-1 that referenced this pull request Mar 19, 2026
…acebook#5069)

Summary:

Fixes a pandas FutureWarning that appears when using `DataFrameGroupBy.apply` on grouping columns by changing to `SeriesGroupBy.apply`. The fix adds `[MAP_KEY]` selector before `.apply()` at line 360 in `ax/core/data.py`, which operates on the series rather than the entire grouped DataFrame. This eliminates the deprecation warning on pandas >= 2.1 while maintaining backward compatibility with older pandas versions.

--
Reviewed + modified AI generated Summary & Test Plan from DEV115723120

Reviewed By: saitcakmak

Differential Revision: D97020436
@eytan eytan force-pushed the export-D97020436 branch from b65893e to 04bea34 Compare March 19, 2026 15:29
…acebook#5069)

Summary:
Pull Request resolved: facebook#5069

Fixes a pandas FutureWarning that appears when using `DataFrameGroupBy.apply` on grouping columns by changing to `SeriesGroupBy.apply`. The fix adds `[MAP_KEY]` selector before `.apply()` at line 360 in `ax/core/data.py`, which operates on the series rather than the entire grouped DataFrame. This eliminates the deprecation warning on pandas >= 2.1 while maintaining backward compatibility with older pandas versions.

--
Reviewed + modified AI generated Summary & Test Plan from DEV115723120

Reviewed By: saitcakmak

Differential Revision: D97020436
@eytan eytan force-pushed the export-D97020436 branch from 04bea34 to d975511 Compare March 19, 2026 15:32
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.30%. Comparing base (04c9aba) to head (d975511).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5069   +/-   ##
=======================================
  Coverage   96.29%   96.30%           
=======================================
  Files         613      613           
  Lines       67232    67232           
=======================================
+ Hits        64742    64747    +5     
+ Misses       2490     2485    -5     

☔ 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.

@meta-codesync
Copy link

meta-codesync bot commented Mar 19, 2026

This pull request has been merged in 1becca4.

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

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants