-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
AIP-47 Migrate ElasticSearch into new system tests #22811
Conversation
I get the following error when I run the test using pytest in breeze environment for Elasticsearch. Could you share your insights on where I am going wrong? I have configured to run the ES in local env and updated the username and password for
|
2ae1af1
to
7913827
Compare
DAG_ID = 'elasticsearch_dag' | ||
CONN_ID = 'elasticsearch_default' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason you moved these globals? They aren't being pulled from ENV and are each only used once, seems perfectly reasonable to me to keep them inlined as they were in the sample DAG?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ferruzzi I followed the steps mentioned in this doc to design the system.
https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-47+New+design+of+Airflow+System+Tests#AIP47NewdesignofAirflowSystemTests-design_details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. I forgot the AIP suggested moving them to globals. Carry on 😛
I am not sure why static check fails here. If anyone knows how to fix this, can you tell me? |
First of all, good that you mention this issue! 👍 This is far from ideal, so I'd also be interested in hearing others' opinions before I set out. |
7913827
to
69f77a7
Compare
It was also noticed in my team last week unfortunately - one of the workaround was to restart the Breeze environment like you mention. The other workaround is to use a unique DAG id between runs (something along DAG_ID = f"name_{uuid.uuid4()}". I will look into this issue and see how it can be fixed. |
tags=["example", "elasticsearch"], | ||
) as dag: | ||
# [START howto_elasticsearch_query] | ||
execute_query = show_tables() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that sphinx will only take content between START and END markers. So your documentation will show:
execute_query = show_tables()
which is not telling much. Unless it's what you intendent consider moving the markers to where you define the show_tables:
[START howto_elasticsearch_query]
@task(task_id='es_print_tables')
def show_tables():
(method body)
[END howto_elasticsearch_query]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Moving them to inside of the method works even better.
@Bowrna @joppevos We used State.None to clear the state of the DAG but it's restricted only to tasks: airflow/airflow/utils/state.py Lines 89 to 90 in a3dd847
I think default state for the DAG should be used instead -> DagRunState.QUEUED. I will update my PR with this change. |
Looks like it's a problem with main, not your code. You can make it retry by closing and reopening the PR, or it will try again when you add a new commit. |
9415648
to
f5fc2cf
Compare
f5fc2cf
to
6ec75ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @bhirsz ?
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
closes: #22445
relates: #22445
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.