https://dagster.io/ logo
#dagster-feedback
Title
# dagster-feedback
d

Daniel Gafni

08/04/2023, 7:42 AM
I would like to have the ability not to skip single-input ops following
is_required=False
outputs when they haven't been produced. My op has an
Optional[...]
typing and handles the case of a missing input in a special way. I still want it to run even if the input wasn't provided. This is possible if another input is provided, so I have to make a dummy input to achieve this behavior. It would be nice if this would be possible without this hack (maybe an argument in the
op
decorator?).
o

owen

08/04/2023, 10:30 PM
hi @Daniel Gafni! Just to confirm, you want to be able to distinguish between: • Some real value was produced • Some value was produced, and that value was
None
• No value was produced at all Is that correct? Not that this is significantly better, but it'd also be possible to do something like:
Copy code
class _NoData():
    pass

@op
def foo(input: Union[int, None, _NoData]):
    if not data_exists:
        return _NoData()
    else:
        return get_data() # can return None or int
d

Daniel Gafni

08/09/2023, 4:33 PM
Hey Owen! Not exactly. I just want to always execute the next op even if the previous didn't return anything. The workaround you suggested requires the
IOManager
to support
None
objects (which I had to do in
dagster-polars
for this exact reason), which is not ideal