Skip to content

Commit

Permalink
feat: core obj
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny Workman <[email protected]>
  • Loading branch information
kennyworkman committed Dec 1, 2021
1 parent 3acd6b6 commit ffb2e6c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions flytekit/core/annotation.py
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

0 comments on commit ffb2e6c

Please sign in to comment.