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

Feature Request: pass parameters from Airflow to GE Checkpoint #108

Open
kujaska opened this issue Apr 19, 2023 · 0 comments
Open

Feature Request: pass parameters from Airflow to GE Checkpoint #108

kujaska opened this issue Apr 19, 2023 · 0 comments

Comments

@kujaska
Copy link

kujaska commented Apr 19, 2023

We need to run a GE checkpoint from Airflow.
Checkpoint is based on SQL query.
SQL query must get values for its parameters from Airflow - e.g. a datamart should be checked for DQ for particular date and region after that date and region were refreshed from another Airflow task.

Part of checkpoint.yml looks like:

validations:
  - batch_request:
      datasource_name: snowflake
      data_connector_name: default_runtime_data_connector_name
      data_asset_name: db1.table1
      runtime_parameters:
        query: "SELECT *
        	from db1.table1
	        WHERE fld1 > $DATE_PARAM_FROM_AIRFLOW and fld2 = $REGION_PARAM_FROM_AIRFLOW
"

How to do it properly with GreatExpectationsOperator?

Looks like it can't pass parameters only,
while query_to_validate or checkpoint_config will break unit tests (you will need airflow to test your checkpoint!)

Workaround: use environment variables.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant