0

I would like Dagster to accept empty parameters in the config.yaml and treat them as having a value of None.

When I start dagit I can see that the parameter is null. This makes sense because I've left the value of the parameter empty in the config.yaml. Dagit shows the parameter as null

However, when I execute the pipeline I get the following error: The error shows it is expecting a string type

I'm not sure why it's expecting a value of class str when I've specified Noneable(str) type in the solid configuration. And funnily enough, when I pass in a non-null value for example_parameter in dagit, the pipeline executes perfectly fine.

Below is the config I used for the solid

@solid(
    description="Example solid",
    config={
        "example_parameter": Field(
                 Noneable(str),
                 is_required=False
        )
    }
)
def example_solid(context):
"""an example solid"""
   etc...

How can I make dagster accept null values and parse them as None?

K.Naga
  • 76
  • 1
  • 6

1 Answers1

0

I tried to reproduce but the pipeline ran successfully with the code snippet you shared and the following config. What version of dagster on you on / could you try upgrading to the latest version (0.8.3)?

@solid(
    description="Example solid",
    config={
        "example_parameter": Field(
                 Noneable(str),
                 is_required=False
        )
    }
)
def example_solid(context):
    context.log.info(str(context.solid_config['example_parameter']))
    pass

@pipeline
def example_pipeline():
    example_solid()

with config

solids:
  example_solid:
    config:
      example_parameter: null
Catherine Wu
  • 356
  • 1
  • 6