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

Make all Pipeline Parameters hashable #4601

Open
lorenzwalthert opened this issue Apr 22, 2024 · 0 comments
Open

Make all Pipeline Parameters hashable #4601

lorenzwalthert opened this issue Apr 22, 2024 · 0 comments
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: feature request

Comments

@lorenzwalthert
Copy link

lorenzwalthert commented Apr 22, 2024

Describe the feature you'd like

Certain operations in Python require hashable objects. While sagemaker.workflow.parameters.ParameterString is hashable, other data types such as ParameterInteger, ParameterBoolean or ParameterFloat are not hashable. To me, it's unclear why only string parameters should be washable, as the underlaying method __hash__(self) could apparently easily be implemented at the sagemaker.workflow.parameters.Parameter instead at sagemaker.workflow.parameters.ParameterString. Currently, it's implemented like this:

    class ParameterString(Parameter):
    # ... 
    def __hash__(self):
        """Hash function for parameter types"""
        return hash(tuple(self.to_request()))

How would this feature be used? Please describe.

Use non-string parameters in places where a hashable object is required, e.g. dict keys.

Describe alternatives you've considered

Use ParameterString everywhere, even when the underlaying data type is not actually a string.

@bmouryakr bmouryakr added component: pipelines Relates to the SageMaker Pipeline Platform type: feature request labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: feature request
Projects
None yet
Development

No branches or pull requests

2 participants