Skip to content
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

Raise error if enum not provided for a value we're trying to encode #2587

Closed

Conversation

danielcohenlive
Copy link

Summary:
We probably want to let the user know if they're trying to encode/save a value we're going to drop. It turns out prior to this diff, a None for the enum that would be used to encode the value is treated differently than an actual enum that just happens to be missing the value. So a missing enum for experiment type would not raise an error if experiment type was passed.

This should debatably only be done in test mode though. Silent failures are generally bad though and we could cause more problems down the road by not saving data we need to.

Differential Revision: D59925061

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 19, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.22%. Comparing base (9679f7b) to head (53b9d66).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2587   +/-   ##
=======================================
  Coverage   95.22%   95.22%           
=======================================
  Files         489      489           
  Lines       47683    47703   +20     
=======================================
+ Hits        45406    45426   +20     
  Misses       2277     2277           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@facebook-github-bot
Copy link
Contributor

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

danielcohenlive pushed a commit to danielcohenlive/Ax-1 that referenced this pull request Jul 19, 2024
…acebook#2587)

Summary:
Pull Request resolved: facebook#2587

We probably want to let the user know if they're trying to encode/save a value we're going to drop.  It turns out prior to this diff, a `None` for the enum that would be used to encode the value is treated differently than an actual enum that just happens to be missing the value.  So a missing enum for experiment type would not raise an error if experiment type was passed.

This should debatably only be done in test mode though.  Silent failures are generally bad though and we could cause more problems down the road by not saving data we need to.

Reviewed By: Cesar-Cardoso

Differential Revision: D59925061
@facebook-github-bot
Copy link
Contributor

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

danielcohenlive pushed a commit to danielcohenlive/Ax-1 that referenced this pull request Jul 19, 2024
…acebook#2587)

Summary:
Pull Request resolved: facebook#2587

We probably want to let the user know if they're trying to encode/save a value we're going to drop.  It turns out prior to this diff, a `None` for the enum that would be used to encode the value is treated differently than an actual enum that just happens to be missing the value.  So a missing enum for experiment type would not raise an error if experiment type was passed.

This should debatably only be done in test mode though.  Silent failures are generally bad though and we could cause more problems down the road by not saving data we need to.

Reviewed By: Cesar-Cardoso

Differential Revision: D59925061
…acebook#2587)

Summary:
Pull Request resolved: facebook#2587

We probably want to let the user know if they're trying to encode/save a value we're going to drop.  It turns out prior to this diff, a `None` for the enum that would be used to encode the value is treated differently than an actual enum that just happens to be missing the value.  So a missing enum for experiment type would not raise an error if experiment type was passed.

This should debatably only be done in test mode though.  Silent failures are generally bad though and we could cause more problems down the road by not saving data we need to.

Reviewed By: Cesar-Cardoso

Differential Revision: D59925061
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in be8e1f7.

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