Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds group to docs #149

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 7 additions & 3 deletions hamilton/function_modifiers/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,15 @@ 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:

def f(dep: List[pd.Series]) -> pd.Series:
return ...
.. code-block:: python

@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