Beispiel #1
0
def test_nb_op(name, path, **kwargs):
    output_defs = kwargs.pop("output_defs",
                             [OutputDefinition(is_required=False)])

    return dagstermill.define_dagstermill_op(
        name=name,
        notebook_path=path,
        output_notebook_name="notebook",
        output_defs=output_defs,
        **kwargs,
    )
Beispiel #2
0
import dagstermill as dm

from dagster import job
from dagster.utils import script_relative_path

k_means_iris = dm.define_dagstermill_op(
    "k_means_iris",
    script_relative_path("iris-kmeans.ipynb"),
    output_notebook_name="iris_kmeans_output",
)


@job(resource_defs={
    "output_notebook_io_manager": dm.local_output_notebook_io_manager,
})
def iris_classify():
    k_means_iris()
Beispiel #3
0
import dagstermill as dm
from dagster import Field, InputDefinition, Int, job
from dagster.utils import script_relative_path
from docs_snippets.legacy.data_science.download_file import download_file

k_means_iris = dm.define_dagstermill_op(
    "k_means_iris",
    script_relative_path("iris-kmeans_2.ipynb"),
    output_notebook_name="iris_kmeans_output",
    input_defs=[
        InputDefinition("path",
                        str,
                        description="Local path to the Iris dataset")
    ],
    config_schema=Field(Int,
                        default_value=3,
                        is_required=False,
                        description="The number of clusters to find"),
)


@job(resource_defs={
    "output_notebook_io_manager": dm.local_output_notebook_io_manager,
})
def iris_classify():
    k_means_iris(download_file())
Beispiel #4
0
import dagstermill as dm
from dagster import InputDefinition, job
from dagster.utils import script_relative_path
from docs_snippets.legacy.data_science.download_file import download_file

k_means_iris = dm.define_dagstermill_op(
    "k_means_iris",
    script_relative_path("iris-kmeans_2.ipynb"),
    output_notebook_name="iris_kmeans_output",
    input_defs=[
        InputDefinition("path",
                        str,
                        description="Local path to the Iris dataset")
    ],
)


@job(resource_defs={
    "output_notebook_io_manager": dm.local_output_notebook_io_manager,
})
def iris_classify():
    k_means_iris(download_file())