This message was deleted.
# hamilton-help
s
This message was deleted.
e
Hey! Yes, a few ways to do this. 1. As you pointed out, you can do this after the fact. This is basically a tool that gets run after a Hamilton DAG that joins the restults — the default one takes a bunch of series/primitives/dataframes and joins them, but it can do whatever you want. So, it could (a) do what the normal one does, and (b) prefix the specified columns, using the input you want. There are a few different ways to do this, and this is likely what I’d recommend — see docs to get started here. 2. You can always do the joining into dataframes in a node itself, then rename as much as you want. While this does have some drawbacks (you’ll end up likely recomputing everything that is a dependency), its a nice way to codify it and specify the output dataset. This could look something like:
Copy code
# you could use @inject to inject them in a group for **kwargs if you don't want to type them out as parameters
def final_df(
    prefix: str="XYZ",
    col_1: pd.Series,
    col_2: pd.Series,
    ...
) -> pd.DataFrame:
    return pd.DataFrame(...) # join the above ones
3. You can do a lot of fancy stuff with other decorators if you’re interested —
@parameterize
can be conditionally included in certain ways, but I’d argue that this is generally going to make things a little messier (everyone has a different preference here…)
m
Thank you, this is helpful. Let me explore and circle back
e
Yep! Feel free to reach out with more Qs/clarifications. Also happy to provide more sample code if its tricky to get started (a lot of constructs — always hope the docs do a good job explaining them but we’re open to feedback)