Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config specified in Frontend is ignored during Job runs #26589

Open
matthias-Q opened this issue Dec 19, 2024 · 1 comment
Open

Config specified in Frontend is ignored during Job runs #26589

matthias-Q opened this issue Dec 19, 2024 · 1 comment
Labels
area: config Related to Configuration type: bug Something isn't working

Comments

@matthias-Q
Copy link

What's the issue?

I have this setup of a configured graph

from dagster import Config, graph, job, op

class DebugConfig(Config):
    value: str


@op
def dbg_op(context, config: DebugConfig):
    context.log.info(config.value)
    return 1


cfg = {"dbg_op": {"config": {"value": "default_value"}}}


@graph(config=cfg)
def dbg_graph():
    return dbg_op()


dbg_job = dbg_graph.to_job()

When running it from the frontend with a custom configuration

ops:
  config:
    dbg_op:
      config:
       value: default_value42

The default config is always used (i.e. the log statement prints out "default_Value" instead of "default_value42"

What did you expect to happen?

The config that is specified in the frontend should overwrite the default config specified in the code.

How to reproduce?

See my example above.

Dagster version

1.9.5

Deployment type

Local

Deployment details

Local & AWS ECS Cluster

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.
By submitting this issue, you agree to follow Dagster's Code of Conduct.

@matthias-Q matthias-Q added the type: bug Something isn't working label Dec 19, 2024
@garethbrickman garethbrickman added the area: config Related to Configuration label Dec 19, 2024
@easontm
Copy link
Contributor

easontm commented Dec 20, 2024

I'm curious as to what the Dagster team has to say about expected behavior of specifying config to the graph, but I can at least give you overrideable-default behavior with this alternative:

from dagster import Config, graph, op, RunConfig

class DebugConfig(Config):
    value: str

@op
def dbg_op(context, config: DebugConfig):
    context.log.info(config.value)
    return 1

@graph
def dbg_graph():
    return dbg_op()

cfg = {"ops": {"dbg_op": {"config": {"value": "default_value"}}}}
dbg_job = dbg_graph.to_job(config=cfg)

dbg_job.execute_in_process(
    run_config=RunConfig(
        ops={
            "dbg_op": {"config": {"value": "bar"}}
        }
    )
)

My suspicion is that passing a config to a graph, where that config defines op behavior within the graph, sort of "bakes it in"to the graph instance and this might actually be intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Related to Configuration type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants