Skip to content

Instantly share code, notes, and snippets.

from typing import Dict, Any
from kedro.io import DataCatalog
from kedro.pipeline import Pipeline
from kedro.runner import SequentialRunner
class MissingOnlySequentialRunner(SequentialRunner):
def run(
self, pipeline: Pipeline, catalog: DataCatalog, run_id: str = None
@antonymilne
antonymilne / hooks.py
Created May 25, 2022 09:27
per-node spark config using hooks
from kedro.framework.context import KedroContext
from kedro.framework.hooks import hook_impl
from kedro.pipeline.node import Node
class SparkHooks:
# Mapping of node names to spark configuration. e.g. node with name node_1
# will use configuration that matches the pattern spark_1* (like spark_1.yml).
# You could make this per-pipeline or done by node.tags if you prefer (so you
# tag each node with the spark config it needs).
In [3]: hello(["--count", 3])
Your name: asdf
Hello, asdf!
Hello, asdf!
Hello, asdf!
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py", line 1065, in main
import sys
import textwrap
import pytest
from kedro.config import ConfigLoader, TemplatedConfigLoader
from kedro.framework.context.context import KedroContext
from kedro.framework.project import configure_project, settings
from kedro.framework.session.store import BaseSessionStore, ShelveStore
from kedro.io import DataCatalog
def register_config_loader(self, conf_paths: Iterable[str]) -> ConfigLoader:
return TemplatedConfigLoader(
conf_paths,
globals_pattern="*globals.yml",
globals_dict={"num_workers": os.environ["num_workers"]},
)
version: 2.1
orbs:
win: circleci/windows@2.2.0
# No windows executor is listed here since windows builds use win/default and modify
# the Python version through the conda environment.
executors:
docker:
parameters:
version: 2.1
orbs:
win: circleci/windows@2.2.0
executors:
py37:
docker:
- image: 350138855857.dkr.ecr.eu-west-2.amazonaws.com/kedro-builder:3.7
resource_class: medium+