aws / aws/sagemaker-python-sdk

Make all Pipeline Parameters hashable

未关闭
#4,601 0 条评论 0 个 reaction 已指派 1 人 已被 @mollyheamazon 认领 在 GitHub 查看
component: pipelines type: feature request
主要语言
Python
星标
2.3k
派生
1.3k
平均合并
1 天 22 小时
30 天内合并 PR
35

描述

**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:

```python
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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。