Skip to content

Commit

Permalink
Adds group to docs
Browse files Browse the repository at this point in the history
We hadn't exposed it. This adds that and corrects the doc string
that will be exposed.
  • Loading branch information
skrawcz committed Apr 24, 2023
1 parent bfc2300 commit 36d4dd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/reference/api-reference/decorators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Classes to help with @parameterize:

.. autoclass:: hamilton.function_modifiers.value

.. autoclass:: hamilton.function_modifiers.group


Actual decorators:
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 3 additions & 1 deletion hamilton/function_modifiers/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ def group(
This means that it gets injected into a list of dependencies that are grouped together. E.G.
dep=group(source("foo"), source("bar")) for the function:
@inject(dep=group(source("foo"), source("bar")))
def f(dep: List[pd.Series]) -> pd.Series:
return ...
Would result in dep getting foo and bar dependencies injected.
:param dependencies: Dependencies, list of dependencies
:param dependency_args: Dependencies, list of dependencies (e.g. source("foo"), source("bar"))
:param dependency_kwargs: Dependencies, kwarg dependencies (e.g. foo=source("foo"))
:return:
"""
_validate_group_params(dependency_args, dependency_kwargs)
Expand Down

0 comments on commit 36d4dd1

Please sign in to comment.