sahil-shetty
02/09/2025, 6:21 PMsahil-shetty
02/09/2025, 6:23 PMsahil-shetty
02/09/2025, 6:25 PMElijah Ben Izzy
02/09/2025, 8:19 PMresolve to do this — https://hamilton.dagworks.io/en/latest/reference/decorators/resolve/#hamilton.function_modifiers.resolve.
In your case it would look like:
@config.when_in(...)
@resolve(
when=ResolveAt.CONFIG_AVAILABLE,
decorate_with=lambda filesystem: parametetrize(
**{f"df__{table_name}": ... for table_name in _get_inputs(filesystem).all_inputs()})
)
Basically it dynamically resolves the decorator later, when the config is available.
That said, I think you may want to consider using @pipe_input/@pipe_output if it’s a series of transformations on a few different dataframes It might simplify it a decent amount, but depends on what the rest of your code is doing…
https://hamilton.dagworks.io/en/latest/reference/decorators/pipe/sahil-shetty
02/09/2025, 9:23 PM@pip_input/@pip_output as well! 🙂