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

Example DAG for GX operators #1

Merged
merged 5 commits into from
Jan 7, 2025
Merged

Example DAG for GX operators #1

merged 5 commits into from
Jan 7, 2025

Conversation

joshua-stauffer
Copy link
Member

@joshua-stauffer joshua-stauffer commented Dec 18, 2024

This PR adds an example dag which uses the three GX operators.

Copy link
Collaborator

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshua-stauffer This is looking great to me. Thanks a lot for your efforts on this one.

I have some minor questions/suggestions in-line, and it's really looking great to me.

dag_id="gx_provider_example_dag",
) as dag:
# define a consistent set of expectations we'll use throughout the pipeline
expectation_suite = ExpectationSuite(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is not an Airflow task can we move this ExpectationSuite outside of the dag definition?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i'll move it out of the DAG, thanks

from airflow import DAG
from airflow.models.baseoperator import chain
from airflow.operators.empty import EmptyOperator
from great_expectations_provider import (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have these imports from great_expectation_provider.operators here and then avoid exposing them in the __init__.py py here

from great_expectations_provider.operators.validate_batch import GXValidateBatchOperator

That would make it easier from maintainability perspective and newer dev efforts adding/removing/deprecating operators so that we don't have to keep on changing them in the __init__.py provider module.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i'll update that, thanks 👍

)
from airflow.decorators import task
from airflow.models.param import Param
from great_expectations import ExpectationSuite, ValidationDefinition, Checkpoint
Copy link
Collaborator

@pankajkoti pankajkoti Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these ExpectationSuite, ValidationDefinition and Checkpoint interfaces defined? Or are they yet to be defined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are great expectations objects, available in the top level GX namespace

@joshua-stauffer joshua-stauffer merged commit ebad877 into main Jan 7, 2025
5 of 6 checks passed
@joshua-stauffer joshua-stauffer deleted the f/example_gx_dag branch January 7, 2025 14:53
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

Successfully merging this pull request may close these issues.

2 participants