hamilton
hamilton copied to clipboard
Documentation for @resolve has broken example
The documentation for @resolve decorator includes this example code:
@parameterize_values(
series_sum_1={"s1": "series_1", "s2": "series_2"},
series_sum_2={"s1": "series_3", "s2": "series_4"},
)
def summation(df: pd.DataFrame, s1: str, s2: str) -> pd.Series:
return df[s1] + df[s2]
However, that is incorrect usage of the @parameterize_values decorator. That is the usage for @parameterize decorator.
Steps to replicate behavior
- Go to the docs page
- Alternatively, view this snapshot of the source content.
Additional context
This example was changed from @parameterize to @parametrize_values in commit 67f7918 17 months ago. I'm unsure if it was valid then, but I'm fairly certain it is not valid now.
@elijahbenizzy As this was your work, can you comment on whether I'm wrong about this?
@Phrogz I think you're right. Parameterize_values looks like this.
Can I contribute to this?