Skip to content

Conversation

@esantorella
Copy link
Contributor

Summary:
Context:

Map values must satisfy two properties:

  • They need to be ordered such that it makes sense to take the largest value and modeled that or to sort on those values.
  • They shouldn't be typed as ints, since as we learned in D79938692 / Ax Use floating-point map key types in Benchmark MapMetrics #4126, this can result in floats getting cast to ints later.
  • They shouldn't be weird since they need to be serializable.

This leaves one obvious candidate: float. Fortunately, existing usages seem to be floats.

This PR:

  • Makes all map keys floats
  • Removes some type annotation logic that is now extraneous
  • Renames a silly test class (I had used "TestMapDataXYZ" to make it easier to run several related groups of tests via CLI then forgot to change it back.)

Differential Revision: D80473359

Summary:
**Context**:

Map values must satisfy two properties:
* They need to be ordered such that it makes sense to take the largest value and modeled that or to sort on those values.
* They shouldn't be typed as ints, since as we learned in D79938692 / Ax facebook#4126, this can result in floats getting cast to ints later.
* They shouldn't be weird since they need to be serializable.

This leaves one obvious candidate: float. Fortunately, existing usages seem to be floats.

**This PR**:

* Makes all map keys floats
* Removes some type annotation logic that is now extraneous
* Renames a silly test class (I had used "TestMapDataXYZ" to make it easier to run several related groups of tests via CLI then forgot to change it back.)

Differential Revision: D80473359
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 18, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80473359

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.06%. Comparing base (585a592) to head (d146f9f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4164   +/-   ##
=======================================
  Coverage   96.05%   96.06%           
=======================================
  Files         566      566           
  Lines       57217    57216    -1     
=======================================
  Hits        54962    54962           
+ Misses       2255     2254    -1     

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in b2adff9.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants