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

Francis Addae

04/20/2022, 11:03 PM
Does anyone know how to use python assertion statements with dagster return variables? Just trying to validate a sql query before I push dbt to run it using dagster
Copy code
@job
def my_pipeline():
    e = checkETL.check_sql_query()
    #assert e == True
    #run dbt Model

if __name__ == "__main__":
    result = my_pipeline.execute_in_process()
    # assert result.output_value ==True
a

Aabir Abubaker Kar

04/21/2022, 6:12 AM
IMO you should put validation logic in an op - something like
Copy code
@job
def my_pipeline():
    dbt_model_op(check_sql_query())

@op
def check_sql_query():
    e = checkETL.check_sql_query()
    return e
so now
dbt_model_op
can check that the ETL (or any input) is validated and end the run (fail gracefully) if not
f

Francis Addae

04/21/2022, 5:38 PM
I do have a validation check within the code. Just need to know the return value when the job is moving from op to op