https://dagster.io/ logo
Title
m

Michel Rouly

07/12/2021, 12:23 PM
Hey folks. Trying out the Memoizable IO Manager and running into what seems like potentially a bug in output creation. I've got this sample code (pasting in thread) using
versioned_filesystem_io_manager
, my Solid has a version property defined, but I'm consistently seeing:
dagster.check.ParameterCheckError: Param "context.version" is not a str. Got None which is type <class 'NoneType'>.
from dagster import repository, solid, pipeline, ModeDefinition
from dagster.core.storage.memoizable_io_manager import versioned_filesystem_io_manager

@solid(version="v0")
def test_solid() -> str:
    return "hello versioned world"

test_mode = ModeDefinition("test_mode", resource_defs={"io_manager": versioned_filesystem_io_manager})

@pipeline(mode_defs=[test_mode])
def test_pipeline():
    test_solid()

@repository()
def test_repo():
    return [test_pipeline]
I was looking around in this slack channel history and I found this issue, but AFAICT I've only got one object that requires versioning (the solid), no other resources.
c

chris

07/12/2021, 2:34 PM
you need to set the
MEMOIZED_RUN_TAG
on your pipeline in order to use the memoizable IO manager.
from dagster.core.storage.tags import MEMOIZED_RUN_TAG

@pipeline(
    mode_defs=[
        ModeDefinition("memoized", resource_defs={"io_manager": versioned_filesystem_io_manager}),
    ],
    tags={MEMOIZED_RUN_TAG: "true"},
)
def my_pipeline():
    return emit_sentence(emit_dog(), emit_tree())
m

Michel Rouly

07/12/2021, 2:34 PM
Gotcha!
Is that documented somewhere and I just missed it?
m

Michel Rouly

07/12/2021, 2:35 PM
Gotcha! I didn't actually know about that page, was just looking at the API docs. Good to know.
c

chris

07/12/2021, 2:35 PM
Yup! No worries. Definitely a bit buried
m

Michel Rouly

07/12/2021, 2:50 PM
Hm, that didn't seem to do the trick either.
@pipeline(mode_defs=[test_mode], tags={"MEMOIZED_RUN_TAG": "true"})
def test_pipeline():
    test_solid()
Still seeing the same failure.
Oh I'm silly, I used a string literal instead of the import. One moment 🙂
c

chris

07/12/2021, 2:52 PM
no worries: let me know if that fixes
m

Michel Rouly

07/12/2021, 2:53 PM
Yep that worked. Although it unfortunately highlights this sentence in that doc page you linked:
Note that memoized execution is not yet supported from Dagit.
Tag "dagster/is_memoized_run" was found when initializing pipeline run, however, memoized execution is only supported from the dagster CLI. This pipeline will run, but outputs from previous executions will be ignored. In order to execute this pipeline using memoization, provide the "dagster/is_memoized_run" tag to the `dagster pipeline execute` CLI. The CLI is documented at the provided link.
Ah well.
Thanks for the assist. Guess I'll wait until support for memoization in Dagit is added 🙂
c

chris

07/12/2021, 3:48 PM
yup - definitely very limited in its support right now but working on changing that.
🙌 1