You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/06/22 08:20:27 UTC

[GitHub] [airflow] ephraimbuddy opened a new pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

ephraimbuddy opened a new pull request #16581:
URL: https://github.com/apache/airflow/pull/16581


   This change moves DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py.
   This is to help newcomers in understanding the scheduler and dag file processor as the files will
   be much smaller.
   
   Consistent use of DR and DM for DagRun and DagModel respectively in the scheduler was also
   done.
   
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #16581:
URL: https://github.com/apache/airflow/pull/16581#issuecomment-866814668


   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy closed pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy closed pull request #16581:
URL: https://github.com/apache/airflow/pull/16581


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy closed pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy closed pull request #16581:
URL: https://github.com/apache/airflow/pull/16581


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy closed pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy closed pull request #16581:
URL: https://github.com/apache/airflow/pull/16581


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #16581:
URL: https://github.com/apache/airflow/pull/16581#discussion_r655991696



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -817,16 +208,16 @@ def _change_state_for_tis_without_dagrun(
         """
         tis_changed = 0
         query = (
-            session.query(models.TaskInstance)
-            .outerjoin(models.TaskInstance.dag_run)
-            .filter(models.TaskInstance.dag_id.in_(list(self.dagbag.dag_ids)))
-            .filter(models.TaskInstance.state.in_(old_states))
+            session.query(TI)

Review comment:
       I think I'd rather we kept this as `TaskInstance` or `models.TaskInstance` instead of `TI`.
   
   
   But either way _this_ type of change should be in a different PR -- this is already a big PR, so keeping changes to a minimum helps the reviewer.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy closed pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy closed pull request #16581:
URL: https://github.com/apache/airflow/pull/16581


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on pull request #16581:
URL: https://github.com/apache/airflow/pull/16581#issuecomment-865736324


   > This PR would mean we have airflow/utils/dag_processing.py and airflow/utils/dagfile_processor.py
   > 
   > I know it might be a big file, but what do you think of putting DagFileProcessor class etc in to the existing `airflow/utils/dag_processing.py` -- that way all of the dag parsing code lives in one file.
   
   It'll be big but being in the same context, I think it's worth being together. Will fix it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on pull request #16581:
URL: https://github.com/apache/airflow/pull/16581#issuecomment-866273862


   > Nice, moving code out of utils/ gets a 👍🏻 from me!
   > 
   > `airflow/dag_processing/dag_processing.py` is a little odd,
   > 
   > How about
   > 
   > `airflow/dag_processing/manager.py` and `airflow/dag_processing/processor.py` as file names? gives it _a_ bit more of a clue what is in each
   
   Nice! Will do that 👍 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil closed pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
kaxil closed pull request #16581:
URL: https://github.com/apache/airflow/pull/16581


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #16581:
URL: https://github.com/apache/airflow/pull/16581#discussion_r656100253



##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -3051,7 +2367,7 @@ def test_verify_integrity_if_dag_not_changed(self):
         dr = drs[0]
 
         # Verify that DagRun.verify_integrity is not called
-        with mock.patch('airflow.jobs.scheduler_job.DagRun.verify_integrity') as mock_verify_integrity:
+        with mock.patch('airflow.jobs.scheduler_job.DR.verify_integrity') as mock_verify_integrity:

Review comment:
       ```suggestion
           with mock.patch('airflow.jobs.scheduler_job.DagRun.verify_integrity') as mock_verify_integrity:
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy merged pull request #16581: Move DagFileProcessor and DagFileProcessorProcess out of scheduler_job.py

Posted by GitBox <gi...@apache.org>.
ephraimbuddy merged pull request #16581:
URL: https://github.com/apache/airflow/pull/16581


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org