-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kenny Workman <[email protected]>
- Loading branch information
1 parent
3acd6b6
commit ffb2e6c
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from typing import Any, Dict | ||
|
||
|
||
class FlyteAnnotation: | ||
"""A core object to add arbitrary annotations to flyte types. | ||
This metadata is ingested as a python dictionary and will be serialized | ||
into fields on the flyteidl type literals. This data is not accessible at | ||
runtime but rather can be retrieved from flyteadmin for custom presentation | ||
of typed parameters. | ||
For a task definition: | ||
.. code-block:: python | ||
@task | ||
def x(a: typing.Annotated[int, FlyteAnnotation({"foo": {"bar": 1}})]): | ||
return | ||
""" | ||
|
||
def __init__(self, data: Dict[str, Any]): | ||
self._data = data | ||
|
||
@property | ||
def data(self): | ||
return self._data |