Skip to content

Bug: RuleAction Enum type was changed #1909

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

Closed
royygael opened this issue Feb 8, 2023 · 7 comments
Closed

Bug: RuleAction Enum type was changed #1909

royygael opened this issue Feb 8, 2023 · 7 comments
Assignees
Labels
feature_flags Feature Flags utility

Comments

@royygael
Copy link
Contributor

royygael commented Feb 8, 2023

Expected Behaviour

Enum should be serilizeable to dict like it was.
Now it is a breaking change

Current Behaviour

Enum breaks when sent not as a value

Code snippet

HOUR_MIN_SEPARATOR = ":"


class RuleAction(Enum): # This should be "class RuleAction(str, Enum):"
    EQUALS = "EQUALS"
    NOT_EQUALS = "NOT_EQUALS"
    KEY_GREATER_THAN_VALUE = "KEY_GREATER_THAN_VALUE"

Possible Solution

class RuleAction(str, Enum):
EQUALS = "EQUALS"
NOT_EQUALS = "NOT_EQUALS"
KEY_GREATER_THAN_VALUE = "KEY_GREATER_THAN_VALUE"

Steps to Reproduce

N/A

AWS Lambda Powertools for Python version

latest

AWS Lambda function runtime

3.6

Packaging format used

Lambda Layers

Debugging logs

No response

@royygael royygael added bug Something isn't working triage Pending triage from maintainers labels Feb 8, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 8, 2023

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our AWS Lambda Powertools Discord: Invite link

@leandrodamascena
Copy link
Contributor

leandrodamascena commented Feb 8, 2023

Hi @royygael, thanks for opening this issue! I'll take a look at this, but I need help understanding it in more detail:

  • Can you give more details about this? How are you using this feature? Do you have a code snippet to simulate this? I tested it in my local environment, in Lambda Runtime and everything worked as expected.

This looks like a Hyrum's law issue, but we don't want to assume anything hence more details before we decide how to proceed it.

Thank you for providing the requested information above.

@leandrodamascena leandrodamascena added the cant-reproduce Any issues that cannot be reproduced label Feb 8, 2023
@leandrodamascena leandrodamascena self-assigned this Feb 9, 2023
@heitorlessa heitorlessa added need-more-information Pending information to continue and removed triage Pending triage from maintainers labels Feb 10, 2023
@royygael
Copy link
Contributor Author

royygael commented Feb 13, 2023 via email

@heitorlessa
Copy link
Contributor

thanks @royygael that makes sense. Let's revert it @leandrodamascena, the perf cost is minimum and we file under https://www.hyrumslaw.com/ type of unexpected dependency of an use case we didn't envision (BUT, we should be sympathetic to our customers who invested like @royygael on that assumption)

@heitorlessa heitorlessa added feature_flags Feature Flags utility and removed bug Something isn't working need-more-information Pending information to continue cant-reproduce Any issues that cannot be reproduced labels Feb 13, 2023
@leandrodamascena
Copy link
Contributor

Ok @heitorlessa! Reverting this.

@heitorlessa
Copy link
Contributor

Adding pending-release and connecting the PR that implemented this. The only thing we missed was an actual test to prevent this "regression" in this future

#1910

@heitorlessa heitorlessa added the pending-release Fix or implementation already in dev waiting to be released label Feb 16, 2023
@github-actions
Copy link
Contributor

This is now released under 2.9.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_flags Feature Flags utility
Projects
None yet
Development

No branches or pull requests

3 participants