Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

use @tag on nodes generated with @parameterize_sources #254

Answered by skrawcz
gravesee asked this question in Q&A
Discussion options

You must be logged in to vote

[edit] We have a new decorator @tag_outputs since 1.12.0 that solves this exact case[/edit]

We have two decorators that you can use together:

  • @tag
  • @tag_outputs

@tag

Tags all the outputs with the same key and value.

@tag_outputs

Tags individual outputs with specific keys and values.

In the example below, we see that @tag is used to set a value for all outputs, while @tag_outputs is only used to add a tag to avg_2wk_spend:

# functions.py
import pandas as pd

from hamilton.function_modifiers import parameterize, tag, tag_outputs
from hamilton.function_modifiers import value, source

@tag_outputs(avg_2wk_spend={"special_tag": "only for avg_2wk_spend"})
@tag(a_tag="this is a tag for all outp…

Replies: 5 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by skrawcz
Comment options

You must be logged in to vote
4 replies
@skrawcz
Comment options

@gravesee
Comment options

@skrawcz
Comment options

@elijahbenizzy
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@elijahbenizzy
Comment options

@gravesee
Comment options

@elijahbenizzy
Comment options

@gravesee
Comment options

@skrawcz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants