astronomer / airflow-provider-great-expectations

Great Expectations Airflow operator
http://greatexpectations.io
Apache License 2.0
157 stars 53 forks source link

Can't use `checkpoint_kwargs` with `conn_id` #143

Open Rmjp opened 2 months ago

Rmjp commented 2 months ago

When I add checkpoint_kwargs to my code it error. But if I delete checkpoint_kwargs the task can run success. This is my code:

GreatExpectationsOperator(
        task_id="task_1234",
        data_context_root_dir="/opt/airflow/plugins/gx/",
        conn_id="postgres",
        schema="public",
        data_asset_name="table",
        query_to_validate=query_sql,
        expectation_suite_name="sample_suite",
        checkpoint_kwargs={
            "action_list":[],
        },
        return_json_dict=True,
        dag=dag,
    )

ERROR:

File "/home/airflow/.local/lib/python3.12/site-packages/great_expectations/checkpoint/checkpoint.py", line 282, in run
    raise gx_exceptions.CheckpointError(
great_expectations.exceptions.exceptions.CheckpointError: Checkpoint "table.sample_suite.chk" must be called with a validator or contain either a batch_request or validations.