hamilton icon indicating copy to clipboard operation
hamilton copied to clipboard

Documentation for @resolve has broken example

Open Phrogz opened this issue 3 months ago • 3 comments

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

  1. Go to the docs page

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.

Phrogz avatar Sep 16 '25 15:09 Phrogz

@elijahbenizzy As this was your work, can you comment on whether I'm wrong about this?

Phrogz avatar Sep 16 '25 15:09 Phrogz

@Phrogz I think you're right. Parameterize_values looks like this.

skrawcz avatar Oct 06 '25 05:10 skrawcz

Can I contribute to this?

mariam-29 avatar Oct 15 '25 21:10 mariam-29