Ben
09/02/2022, 5:19 PM@parameterize[-sources]
with @extract_columns
? (i.e. to get multiple columns back from a parameterized function) I can't wrap my head around how it would work, if it is.Stefan Krawczyk
09/02/2022, 5:22 PMBen
09/02/2022, 5:25 PM@parameterize
(as an expanded dict comprehension), ideally I could just specify multiple output columns there.Stefan Krawczyk
09/02/2022, 5:30 PMextract_columns
is just syntactic sugar for:
def column_a(my_df: pd.Dataframe) -> pd.Series:
return my_df['column_a']
def column_b(my_df: pd.Dataframe) -> pd.Series:
return my_df['column_b']
Which I think (would need to write some code to prove this to myself) you could write as a separate parametrize function itself, rather than sticking it all into one parameterize function.Elijah Ben Izzy
09/02/2022, 5:36 PM@parameterize
decorator — allows for both values and inputs :)Ben
09/02/2022, 6:16 PM@parameterize
, it's great -- although the docs are a little confusing still, they talk about source()
and value()
initially and then about upstream()
and literal()
, are they the same things? Or is upstream/literal an old way of writing it?)Elijah Ben Izzy
09/02/2022, 6:27 PMStefan Krawczyk
09/02/2022, 6:27 PM(I’m already using[edit] what @Elijah Ben Izzy said [/edit]. If you have time please feel free to create an issue for this — else I’ll try to get to this in the afternoon, if not early next week., it’s great -- although the docs are a little confusing still, they talk about@parameterize
andsource()
initially and then aboutvalue()
andupstream()
, are they the same things? Or is upstream/literal an old way of writing it?literal()
Elijah Ben Izzy
09/02/2022, 6:29 PMStefan Krawczyk
09/02/2022, 10:49 PMElijah Ben Izzy
09/03/2022, 2:58 AMMichael Cunningham
11/08/2022, 5:29 PM@parameterize_sources
and @extract_columns
functionality (like I was): https://github.com/stitchfix/hamilton/issues/196Elijah Ben Izzy
11/08/2022, 7:57 PMMichael Cunningham
11/08/2022, 8:10 PM@parameterize_sources
with a function that outputs a DataFrame and then unique functions to then extract the columns (there is a good example with in the issue that shows this with the my_disaggregator functions with @extract_columns
).Elijah Ben Izzy
11/18/2022, 12:55 AM