Hi all, is there a way to access my config paramet...
# hamilton-help
s
Hi all, is there a way to access my config parameters while building the driver? (my use case in thread below)
It currently breaks at line 158
can config attributes be accessed or perhaps there's a better option of doing this?
e
OK, from what I understand you’re asking how to get config as part of the decorator, right? You have
resolve
to do this — https://hamilton.dagworks.io/en/latest/reference/decorators/resolve/#hamilton.function_modifiers.resolve. In your case it would look like:
Copy code
@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/
👍 2
s
Thank you, appreciate it. I'll have a look at
@pip_input/@pip_output
as well! 🙂