-
Notifications
You must be signed in to change notification settings - Fork 358
Fix np.int64 vs int type mismatch in Data.trial_indices #4796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mgarrard
wants to merge
1
commit into
facebook:main
Choose a base branch
from
mgarrard:export-D91185468
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+21
−19
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4796 +/- ##
==========================================
- Coverage 96.70% 96.70% -0.01%
==========================================
Files 587 587
Lines 61294 61302 +8
==========================================
+ Hits 59277 59282 +5
- Misses 2017 2020 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
0304bcb to
f053b59
Compare
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 22, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
f053b59 to
fe02228
Compare
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 23, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
fe02228 to
3218b82
Compare
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 23, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
3218b82 to
599b383
Compare
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 23, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
mgarrard
added a commit
to mgarrard/Ax
that referenced
this pull request
Jan 23, 2026
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA The `trial_indices` property returns `set[np.int64]` from `.unique()` on numpy-backed dataframes, but `experiment.trials.keys()` returns Python `int`. Set operations fail because `np.int64` and `int` are treated as different types in set comparisons. Convert numpy types to Python int using set comprehension. Differential Revision: D91185468
Summary: Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA There was an upgrade to panadas wed where pandas 3.0 was released, this is causing 3.12 tests to fail on GH exports. This diff resolves this. Three main things we handle here: 1. dtypes for string columns are now infered as StringDtype, so we should be expecting this instead of legacy object dtype 2. Numpy arrarys are read-only by default now, in order to write to them we need to explicitly copy() the 3. int in dfs became int64, reconverted to python int for set operations Differential Revision: D91185468
599b383 to
56dcb7b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Prompted after some failures in exports not related to my changes: https://github.com/facebook/Ax/actions/runs/21225324302/job/61070638075?fbclid=IwY2xjawPeXMFleHRuA2FlbQIxMQBicmlkETFRTkR6WlE4NHVrd3IyQXNlc3J0YwZhcHBfaWQBMAABHjTAiZi71n24w95hvzEewrKNPKOGzJisgR7t4qJ3APRMYlusgFC-gu7RLiSb_aem_Zk3pmTDonCFsJvZCTkpeMA
The
trial_indicesproperty returnsset[np.int64]from.unique()onnumpy-backed dataframes, but
experiment.trials.keys()returns Pythonint.Set operations fail because
np.int64andintare treated as differenttypes in set comparisons.
Convert numpy types to Python int using set comprehension.
Differential Revision: D91185468