dagstermill 0.26.6rc0__tar.gz → 0.26.7rc0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dagstermill might be problematic. Click here for more details.
- {dagstermill-0.26.6rc0/dagstermill.egg-info → dagstermill-0.26.7rc0}/PKG-INFO +1 -1
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/__init__.py +1 -1
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/cli.py +1 -1
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/examples/repository.py +3 -3
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/factory.py +3 -3
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/serialize.py +2 -2
- dagstermill-0.26.7rc0/dagstermill/test_utils.py +45 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/translator.py +3 -3
- dagstermill-0.26.7rc0/dagstermill/version.py +1 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0/dagstermill.egg-info}/PKG-INFO +1 -1
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill.egg-info/SOURCES.txt +1 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill.egg-info/requires.txt +1 -1
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/setup.py +1 -1
- dagstermill-0.26.6rc0/dagstermill/version.py +0 -1
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/LICENSE +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/MANIFEST.in +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/README.md +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/__main__.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/asset_factory.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/compat.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/context.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/engine.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/errors.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/examples/__init__.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/io_managers.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/manager.py +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill/py.typed +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill.egg-info/dependency_links.txt +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill.egg-info/entry_points.txt +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/dagstermill.egg-info/top_level.txt +0 -0
- {dagstermill-0.26.6rc0 → dagstermill-0.26.7rc0}/setup.cfg +0 -0
|
@@ -7,8 +7,8 @@ from typing import Optional
|
|
|
7
7
|
import click
|
|
8
8
|
import dagster._check as check
|
|
9
9
|
import nbformat
|
|
10
|
-
from dagster._seven.json import loads
|
|
11
10
|
from dagster._utils import mkdir_p, safe_isfile
|
|
11
|
+
from dagster_shared.seven.json import loads
|
|
12
12
|
from papermill.iorw import load_notebook_node, write_ipynb
|
|
13
13
|
|
|
14
14
|
|
|
@@ -303,12 +303,12 @@ def error_job():
|
|
|
303
303
|
|
|
304
304
|
if DAGSTER_PANDAS_PRESENT and SKLEARN_PRESENT and MATPLOTLIB_PRESENT:
|
|
305
305
|
# We need type-ignores here because type checkers don't understand the `*_PRESENT` kwargs.
|
|
306
|
-
clean_data = test_nb_op("clean_data", outs={DEFAULT_OUTPUT: Out(DataFrame)})
|
|
306
|
+
clean_data = test_nb_op("clean_data", outs={DEFAULT_OUTPUT: Out(DataFrame)}) # pyright: ignore[reportPossiblyUnboundVariable]
|
|
307
307
|
|
|
308
308
|
# FIXME add an output to this
|
|
309
|
-
tutorial_LR = test_nb_op("tutorial_LR", ins={"df": In(DataFrame)})
|
|
309
|
+
tutorial_LR = test_nb_op("tutorial_LR", ins={"df": In(DataFrame)}) # pyright: ignore[reportPossiblyUnboundVariable]
|
|
310
310
|
|
|
311
|
-
tutorial_RF = test_nb_op("tutorial_RF", ins={"df": In(DataFrame)})
|
|
311
|
+
tutorial_RF = test_nb_op("tutorial_RF", ins={"df": In(DataFrame)}) # pyright: ignore[reportPossiblyUnboundVariable]
|
|
312
312
|
|
|
313
313
|
@job(resource_defs=common_resource_defs)
|
|
314
314
|
def tutorial_job():
|
|
@@ -15,7 +15,6 @@ from dagster import (
|
|
|
15
15
|
Out,
|
|
16
16
|
Output,
|
|
17
17
|
_check as check,
|
|
18
|
-
_seven,
|
|
19
18
|
)
|
|
20
19
|
from dagster._annotations import beta
|
|
21
20
|
from dagster._config.pythonic_config import Config, infer_schema_from_config_class
|
|
@@ -29,10 +28,11 @@ from dagster._core.execution.context.system import StepExecutionContext
|
|
|
29
28
|
from dagster._core.execution.plan.outputs import StepOutputHandle
|
|
30
29
|
from dagster._core.storage.tags import COMPUTE_KIND_TAG
|
|
31
30
|
from dagster._serdes import pack_value
|
|
32
|
-
from dagster._seven import get_system_temp_directory
|
|
33
31
|
from dagster._utils import mkdir_p, safe_tempfile_path
|
|
34
32
|
from dagster._utils.error import serializable_error_info_from_exc_info
|
|
35
33
|
from dagster._utils.tags import normalize_tags
|
|
34
|
+
from dagster_shared import seven
|
|
35
|
+
from dagster_shared.seven import get_system_temp_directory
|
|
36
36
|
from papermill.engines import papermill_engines
|
|
37
37
|
from papermill.iorw import load_notebook_node, write_ipynb
|
|
38
38
|
|
|
@@ -105,7 +105,7 @@ def replace_parameters(context, nb, parameters):
|
|
|
105
105
|
after = nb.cells
|
|
106
106
|
|
|
107
107
|
nb.cells = before + [newcell] + after
|
|
108
|
-
nb.metadata.papermill["parameters"] =
|
|
108
|
+
nb.metadata.papermill["parameters"] = seven.json.dumps(parameters)
|
|
109
109
|
|
|
110
110
|
return nb
|
|
111
111
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from contextlib import contextmanager
|
|
3
|
+
|
|
4
|
+
from dagster import execute_job
|
|
5
|
+
from dagster._core.definitions.metadata import NotebookMetadataValue, PathMetadataValue
|
|
6
|
+
from dagster._core.definitions.reconstruct import ReconstructableJob
|
|
7
|
+
from dagster._core.test_utils import instance_for_test
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_path(materialization_event):
|
|
11
|
+
for value in materialization_event.event_specific_data.materialization.metadata.values():
|
|
12
|
+
if isinstance(value, (PathMetadataValue, NotebookMetadataValue)):
|
|
13
|
+
return value.path
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def cleanup_result_notebook(result):
|
|
17
|
+
if not result:
|
|
18
|
+
return
|
|
19
|
+
materialization_events = [
|
|
20
|
+
x for x in result.all_events if x.event_type_value == "ASSET_MATERIALIZATION"
|
|
21
|
+
]
|
|
22
|
+
for materialization_event in materialization_events:
|
|
23
|
+
result_path = get_path(materialization_event)
|
|
24
|
+
if os.path.exists(result_path): # pyright: ignore[reportArgumentType]
|
|
25
|
+
os.unlink(result_path) # pyright: ignore[reportArgumentType]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@contextmanager
|
|
29
|
+
def exec_for_test(fn_name, env=None, raise_on_error=True, **kwargs):
|
|
30
|
+
result = None
|
|
31
|
+
recon_job = ReconstructableJob.for_module("dagstermill.examples.repository", fn_name)
|
|
32
|
+
|
|
33
|
+
with instance_for_test() as instance:
|
|
34
|
+
try:
|
|
35
|
+
with execute_job(
|
|
36
|
+
job=recon_job,
|
|
37
|
+
run_config=env,
|
|
38
|
+
instance=instance,
|
|
39
|
+
raise_on_error=raise_on_error,
|
|
40
|
+
**kwargs,
|
|
41
|
+
) as result:
|
|
42
|
+
yield result
|
|
43
|
+
finally:
|
|
44
|
+
if result:
|
|
45
|
+
cleanup_result_notebook(result)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import papermill
|
|
2
2
|
import papermill.translators
|
|
3
|
-
from
|
|
3
|
+
from dagster_shared import seven
|
|
4
4
|
|
|
5
5
|
RESERVED_INPUT_NAMES = [
|
|
6
6
|
"__dm_context",
|
|
@@ -16,7 +16,7 @@ RESERVED_INPUT_NAMES = [
|
|
|
16
16
|
|
|
17
17
|
INJECTED_BOILERPLATE = """
|
|
18
18
|
# Injected parameters
|
|
19
|
-
from
|
|
19
|
+
from dagster_shared import seven as __dm_seven
|
|
20
20
|
import dagstermill as __dm_dagstermill
|
|
21
21
|
context = __dm_dagstermill._reconstitute_job_context(
|
|
22
22
|
**{{
|
|
@@ -51,7 +51,7 @@ class DagsterTranslator(papermill.translators.PythonTranslator):
|
|
|
51
51
|
)
|
|
52
52
|
|
|
53
53
|
for key in job_context_args:
|
|
54
|
-
job_context_args[key] =
|
|
54
|
+
job_context_args[key] = seven.json.dumps(job_context_args[key])
|
|
55
55
|
|
|
56
56
|
content = INJECTED_BOILERPLATE.format(job_context_args=job_context_args)
|
|
57
57
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.26.7rc0"
|
|
@@ -31,7 +31,7 @@ setup(
|
|
|
31
31
|
],
|
|
32
32
|
python_requires=">=3.9,<3.13",
|
|
33
33
|
install_requires=[
|
|
34
|
-
"dagster==1.10.
|
|
34
|
+
"dagster==1.10.7rc0",
|
|
35
35
|
# ipykernel 5.4.0 and 5.4.1 broke papermill
|
|
36
36
|
# see https://github.com/dagster-io/dagster/issues/3401,
|
|
37
37
|
# https://github.com/nteract/papermill/issues/519,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.26.6rc0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|