-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
Need a commit message that informs of design decisions please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need tag_nodes
to handle the "all case"? Why not just double up on decorators?
d7e3398
to
5c9f8ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some docs tuning, otherwise looks good!
decorators.md
Outdated
### @tag_outputs | ||
|
||
`tag_outputs` enables you to attach metadata to a function that outputs multiple nodes, | ||
and give different tag values to different items: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and give different tag values to different items: | |
and give different tag values to different outputs: |
items isn't a term we use.
decorators.md
Outdated
## @tag | ||
## @tag and friends | ||
|
||
### @tag | ||
|
||
Allows you to attach metadata to a node (any node decorated with the function). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows you to attach metadata to a node (any node decorated with the function). | |
Allows you to attach metadata to an output(s), i.e. all nodes generated by a function and its decorators. |
decorators.md
Outdated
@extract_columns('public', 'private') | ||
def data_used_in_multiple_ways() -> pd.DataFrame: | ||
return load_some_data(...) | ||
``` | ||
|
||
In the case above, `common_tag` would resolve to `foo` for `public` and `bar` for `private`. | ||
Attempting an override in the reverse direction is currently undefined behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@extract_columns('public', 'private') | |
def data_used_in_multiple_ways() -> pd.DataFrame: | |
return load_some_data(...) | |
``` | |
In the case above, `common_tag` would resolve to `foo` for `public` and `bar` for `private`. | |
Attempting an override in the reverse direction is currently undefined behavior. | |
@extract_columns('column_a', 'column_b') | |
def data_used_in_multiple_ways() -> pd.DataFrame: | |
return load_some_data(...) | |
``` | |
In the case above, `common_tag` would resolve to `foo` for `column_a` and `bar` for `column_b`. | |
Attempting an override in the reverse direction is currently undefined behavior. |
5c9f8ba
to
dadd319
Compare
Solves #254 `tag_outputs` enables you to attach metadata to a function that outputs multiple nodes, and give different tag values to different items. This can be applied multiple times, and precedence order of the `tag` family of nodes is in reverse application order (see docs). Note that if we have `tag` before `tag_outputs` this is undefined behavior.
dadd319
to
7b7ee35
Compare
See #254