Skip to content

KedroTask

Bases: Task

Kedro node as a Prefect task.

Source code in make_us_rich/worker/kedro_task.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class KedroTask(Task):
    """Kedro node as a Prefect task."""

    _max_retries = 5
    _retry_delay = timedelta(minutes=2)


    def __init__(self, node: Node, catalog: DataCatalog) -> None:
        self._node = node
        self._catalog = catalog
        super().__init__(
            name=node.name, 
            tags=node.tags,
            max_retries=self._max_retries,
            retry_delay=self._retry_delay
        )


    def run(self):
        """Run the node."""
        run_node(self._node, self._catalog)

run()

Run the node.

Source code in make_us_rich/worker/kedro_task.py
28
29
30
def run(self):
    """Run the node."""
    run_node(self._node, self._catalog)

ProjectMetadata

Bases: NamedTuple

Structure holding project metadata derived from pyproject.toml

Source code in make_us_rich/worker/project_metadata.py
20
21
22
23
24
25
26
27
28
class ProjectMetadata(NamedTuple):
    """Structure holding project metadata derived from `pyproject.toml`"""

    config_file: Path
    package_name: str
    project_name: str
    project_path: Path
    project_version: str
    source_dir: Path

Last update: 2022-05-04