Volker Lorrmann
05/14/2024, 10:46 AMInvalidDecoratorException: Expected a single node to transform, but got 2. <class
'hamilton.function_modifiers.expanders.extract_columns'> can only operate on a single node, but multiple nodes were
created by df_raw
Here is a simple toy example:
@extract_columns("col1", "col2", "key")
@parameterize(
api_data_1=dict(asset_id=value("123abc"),
api_data_2=dict(asset_id=value("321cba")
)
def api_data(asset_id=str)->pd.DataFrame:
return my_data_fetcher(asset_id=asset_id)
def joined_data(api_data_1:pd.DataFrame, api_data_2:pd.DataFrame)->pd.DataFrame:
return api_data_1.join(api_data_2, on="key")
I think the problem is related to the @extract_columns + @parameterize. Is there a work around, or should place the column selection into the function and skip the usage of @extract_columns?Elijah Ben Izzy
05/14/2024, 2:09 PMElijah Ben Izzy
05/14/2024, 2:10 PMVolker Lorrmann
05/15/2024, 5:34 AM