-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Test that DagFileProcessor can operator against on a Serialized DAG #8739
Conversation
Looks like it works fine :) |
81e6ae8
to
e29c35c
Compare
b36b276
to
f3dbc38
Compare
Just the Travis/Kube tests failing now. And they have been doing that for a while now :( |
26110c3
to
06932e0
Compare
As part of the scheduler HA work we are going to want to separate the parsing from the scheduling, so this changes the tests to ensure that the important methods of DagFileProcessor can do everything the need to when given a SerializedDAG, not just a DAG. i.e. that we have correctly serialized all the necessary fields.
06932e0
to
da07181
Compare
@@ -117,7 +116,6 @@ def test_remove_stale_dags(self): | |||
self.assertFalse(SDM.has_dag(stale_dag.dag_id)) | |||
self.assertTrue(SDM.has_dag(fresh_dag.dag_id)) | |||
|
|||
@mock.patch('airflow.models.serialized_dag.STORE_SERIALIZED_DAGS', True) | |||
def test_bulk_sync_to_db(self): |
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.
How does this test work now, this doesn't store serialized DAG anymore, does it ?
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.
I mean with the patch, it would only sync and write DAGs to DAGModel table and assert that queries count is 7, is that the intention
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.
SDM.bulk_sync_to_db
will now always write to the DB when called.
Before it would return if the config was false. Now the check is moved in to DagBag.bulk_sync:
if self.store_serialized_dags:
SerializedDagModel.bulk_sync_to_db(self.dags.values())
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.
(This test isn't great, but that wasn't changed by this)
As part of the scheduler HA work we are going to want to separate the
parsing from the scheduling, so this changes the tests to ensure that
the important methods of DagFileProcessor can do everything the need to
when given a SerializedDAG, not just a DAG. i.e. that we have correctly
serialized all the necessary fields.
Make sure to mark the boxes below before creating PR: [x]
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.
Read the Pull Request Guidelines for more information.