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 2020/04/02 01:47:29 UTC

[GitHub] [airflow] kaxil opened a new pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

kaxil opened a new pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051
 
 
   This is because "The composite IN construct is not supported by all backends"
   
   Based on the discussion in https://github.com/apache/airflow/pull/6788#discussion_r391268396
   
   I can't use **JOIN** because of the following restriction:
   
   ```
   sqlalchemy.exc.InvalidRequestError: Can't call Query.update() or Query.delete() when join(), outerjoin(), select_from(), or from_self() has been called
   ```
   
   ---
   Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg)
   
   Make sure to mark the boxes below before creating PR: [x]
   
   - [x] Description above provides context of the change
   - [x] Unit tests coverage for changes (not needed for documentation changes)
   - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [x] Relevant documentation is updated including usage instructions.
   - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   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/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#discussion_r402015638
 
 

 ##########
 File path: tests/models/test_renderedtifields.py
 ##########
 @@ -139,29 +147,27 @@ def test_delete_old_records(self):
         with dag:
             task = BashOperator(task_id="test", bash_command="echo {{ ds }}")
 
-        rtif_1 = RTIF(TI(task=task, execution_date=EXECUTION_DATE))
-        rtif_2 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=1)))
-        rtif_3 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=2)))
+        rtif_list = [
+            RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=num)))
+            for num in range(rtif_num)
+        ]
 
-        session.add(rtif_1)
-        session.add(rtif_2)
-        session.add(rtif_3)
+        session.add_all(rtif_list)
         session.commit()
 
         result = session.query(RTIF)\
             .filter(RTIF.dag_id == dag.dag_id, RTIF.task_id == task.task_id).all()
 
-        self.assertIn(rtif_1, result)
-        self.assertIn(rtif_2, result)
-        self.assertIn(rtif_3, result)
-        self.assertEqual(3, len(result))
+        for rtif in rtif_list:
+            self.assertIn(rtif, result)
+
+        self.assertEqual(rtif_num, len(result))
 
-        # Verify old records are deleted and only 1 record is kept
-        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=1)
+        # Verify old records are deleted and only 'num_to_keep' records are kept
+        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=num_to_keep)
 
 Review comment:
   https://github.com/apache/airflow/blob/master/tests/test_utils/asserts.py#L67

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.72%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.53%   -0.73%     
   ==========================================
     Files         935      935              
     Lines       45384    45384              
   ==========================================
   - Hits        39601    39271     -330     
   - Misses       5783     6113     +330     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `97.91% <100.00%> (+2.08%)` | :arrow_up: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...e2c1c1f](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] kaxil commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#discussion_r402024161
 
 

 ##########
 File path: tests/models/test_renderedtifields.py
 ##########
 @@ -139,29 +147,27 @@ def test_delete_old_records(self):
         with dag:
             task = BashOperator(task_id="test", bash_command="echo {{ ds }}")
 
-        rtif_1 = RTIF(TI(task=task, execution_date=EXECUTION_DATE))
-        rtif_2 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=1)))
-        rtif_3 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=2)))
+        rtif_list = [
+            RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=num)))
+            for num in range(rtif_num)
+        ]
 
-        session.add(rtif_1)
-        session.add(rtif_2)
-        session.add(rtif_3)
+        session.add_all(rtif_list)
         session.commit()
 
         result = session.query(RTIF)\
             .filter(RTIF.dag_id == dag.dag_id, RTIF.task_id == task.task_id).all()
 
-        self.assertIn(rtif_1, result)
-        self.assertIn(rtif_2, result)
-        self.assertIn(rtif_3, result)
-        self.assertEqual(3, len(result))
+        for rtif in rtif_list:
+            self.assertIn(rtif, result)
+
+        self.assertEqual(rtif_num, len(result))
 
-        # Verify old records are deleted and only 1 record is kept
-        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=1)
+        # Verify old records are deleted and only 'num_to_keep' records are kept
+        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=num_to_keep)
 
 Review comment:
   Updated

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.73%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.52%   -0.74%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39276     -325     
   - Misses       5783     6116     +333     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.73%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.52%   -0.74%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39276     -325     
   - Misses       5783     6116     +333     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] kaxil commented on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607591263
 
 
   > What do you think about support two paths? on supported databases, we can use faster single queries. On less featurefull databases, we can use two queries.
   > Similar to: https://github.com/apache/airflow/blob/master/airflow/jobs/scheduler_job.py#L1092
   
   Updated

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] kaxil edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607591263
 
 
   > What do you think about support two paths? on supported databases, we can use faster single queries. On less featurefull databases, we can use two queries.
   > Similar to: https://github.com/apache/airflow/blob/master/airflow/jobs/scheduler_job.py#L1092
   
   Agree, updated

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.73%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.52%   -0.74%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39276     -325     
   - Misses       5783     6116     +333     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] kaxil commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#discussion_r402022036
 
 

 ##########
 File path: airflow/models/renderedtifields.py
 ##########
 @@ -110,28 +110,20 @@ def delete_old_records(
             return
 
         # Fetch Top X records given dag_id & task_id ordered by Execution Date
-        subq1 = (
+        tis_to_keep = (
             session
             .query(cls.dag_id, cls.task_id, cls.execution_date)
             .filter(cls.dag_id == dag_id, cls.task_id == task_id)
             .order_by(cls.execution_date.desc())
             .limit(num_to_keep)
-            .subquery('subq1')
-        )
-
-        # Second Subquery
-        # Workaround for MySQL Limitation (https://stackoverflow.com/a/19344141/5691525)
-        # Limitation: This version of MySQL does not yet support
-        # LIMIT & IN/ALL/ANY/SOME subquery
-        subq2 = (
-            session
-            .query(subq1.c.dag_id, subq1.c.task_id, subq1.c.execution_date)
-            .subquery('subq2')
-        )
+        ).all()
+
+        filter_tis = [not_(and_(
+            cls.dag_id == ti.dag_id,
+            cls.task_id == ti.task_id,
+            cls.execution_date == ti.execution_date
+        )) for ti in tis_to_keep]
 
 Review comment:
   That method is different from RenderedTaskInstanceFields. That method uses TaskInstance model. This is for RenderedTaskInstanceFields

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607582198
 
 
   What do you think about support two paths? on supported databases, we can use faster single queries. On less featurefull databases, we can use two queries.
   Similar to: https://github.com/apache/airflow/blob/master/airflow/jobs/scheduler_job.py#L1092

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#discussion_r402035653
 
 

 ##########
 File path: tests/models/test_renderedtifields.py
 ##########
 @@ -139,29 +147,27 @@ def test_delete_old_records(self):
         with dag:
             task = BashOperator(task_id="test", bash_command="echo {{ ds }}")
 
-        rtif_1 = RTIF(TI(task=task, execution_date=EXECUTION_DATE))
-        rtif_2 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=1)))
-        rtif_3 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=2)))
+        rtif_list = [
+            RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=num)))
+            for num in range(rtif_num)
+        ]
 
-        session.add(rtif_1)
-        session.add(rtif_2)
-        session.add(rtif_3)
+        session.add_all(rtif_list)
         session.commit()
 
         result = session.query(RTIF)\
             .filter(RTIF.dag_id == dag.dag_id, RTIF.task_id == task.task_id).all()
 
-        self.assertIn(rtif_1, result)
-        self.assertIn(rtif_2, result)
-        self.assertIn(rtif_3, result)
-        self.assertEqual(3, len(result))
+        for rtif in rtif_list:
+            self.assertIn(rtif, result)
+
+        self.assertEqual(rtif_num, len(result))
 
-        # Verify old records are deleted and only 1 record is kept
-        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=1)
+        # Verify old records are deleted and only 'num_to_keep' records are kept
+        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=num_to_keep)
 
 Review comment:
   😻 

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#discussion_r402015516
 
 

 ##########
 File path: tests/models/test_renderedtifields.py
 ##########
 @@ -139,29 +147,27 @@ def test_delete_old_records(self):
         with dag:
             task = BashOperator(task_id="test", bash_command="echo {{ ds }}")
 
-        rtif_1 = RTIF(TI(task=task, execution_date=EXECUTION_DATE))
-        rtif_2 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=1)))
-        rtif_3 = RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=2)))
+        rtif_list = [
+            RTIF(TI(task=task, execution_date=EXECUTION_DATE + timedelta(days=num)))
+            for num in range(rtif_num)
+        ]
 
-        session.add(rtif_1)
-        session.add(rtif_2)
-        session.add(rtif_3)
+        session.add_all(rtif_list)
         session.commit()
 
         result = session.query(RTIF)\
             .filter(RTIF.dag_id == dag.dag_id, RTIF.task_id == task.task_id).all()
 
-        self.assertIn(rtif_1, result)
-        self.assertIn(rtif_2, result)
-        self.assertIn(rtif_3, result)
-        self.assertEqual(3, len(result))
+        for rtif in rtif_list:
+            self.assertIn(rtif, result)
+
+        self.assertEqual(rtif_num, len(result))
 
-        # Verify old records are deleted and only 1 record is kept
-        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=1)
+        # Verify old records are deleted and only 'num_to_keep' records are kept
+        RTIF.delete_old_records(task_id=task.task_id, dag_id=task.dag_id, num_to_keep=num_to_keep)
 
 Review comment:
   Can you add assertions on the number of queries here? We are trying to optimize these function to make them as efficient as possible. This should be reflected in the tests.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] kaxil merged pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051
 
 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.72%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.53%   -0.73%     
   ==========================================
     Files         935      935              
     Lines       45384    45384              
   ==========================================
   - Hits        39601    39271     -330     
   - Misses       5783     6113     +330     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `97.91% <100.00%> (+2.08%)` | :arrow_up: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...e2c1c1f](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#discussion_r402035176
 
 

 ##########
 File path: airflow/models/renderedtifields.py
 ##########
 @@ -110,28 +110,20 @@ def delete_old_records(
             return
 
         # Fetch Top X records given dag_id & task_id ordered by Execution Date
-        subq1 = (
+        tis_to_keep = (
             session
             .query(cls.dag_id, cls.task_id, cls.execution_date)
             .filter(cls.dag_id == dag_id, cls.task_id == task_id)
             .order_by(cls.execution_date.desc())
             .limit(num_to_keep)
-            .subquery('subq1')
-        )
-
-        # Second Subquery
-        # Workaround for MySQL Limitation (https://stackoverflow.com/a/19344141/5691525)
-        # Limitation: This version of MySQL does not yet support
-        # LIMIT & IN/ALL/ANY/SOME subquery
-        subq2 = (
-            session
-            .query(subq1.c.dag_id, subq1.c.task_id, subq1.c.execution_date)
-            .subquery('subq2')
-        )
+        ).all()
+
+        filter_tis = [not_(and_(
+            cls.dag_id == ti.dag_id,
+            cls.task_id == ti.task_id,
+            cls.execution_date == ti.execution_date
+        )) for ti in tis_to_keep]
 
 Review comment:
   Och. Right. 

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.25%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   87.00%   -0.26%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39493     -108     
   - Misses       5783     5899     +116     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [...viders/cncf/kubernetes/operators/kubernetes\_pod.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvY25jZi9rdWJlcm5ldGVzL29wZXJhdG9ycy9rdWJlcm5ldGVzX3BvZC5weQ==) | `69.69% <0.00%> (-25.26%)` | :arrow_down: |
   | [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0.00%> (-23.53%)` | :arrow_down: |
   | [airflow/jobs/backfill\_job.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9qb2JzL2JhY2tmaWxsX2pvYi5weQ==) | `90.52% <0.00%> (+0.27%)` | :arrow_up: |
   | [airflow/jobs/scheduler\_job.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9qb2JzL3NjaGVkdWxlcl9qb2IucHk=) | `90.94% <0.00%> (+0.43%)` | :arrow_up: |
   | [airflow/providers/postgres/hooks/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvaG9va3MvcG9zdGdyZXMucHk=) | `94.44% <0.00%> (+1.38%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.73%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.52%   -0.74%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39276     -325     
   - Misses       5783     6116     +333     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#discussion_r402020441
 
 

 ##########
 File path: airflow/models/renderedtifields.py
 ##########
 @@ -110,28 +110,20 @@ def delete_old_records(
             return
 
         # Fetch Top X records given dag_id & task_id ordered by Execution Date
-        subq1 = (
+        tis_to_keep = (
             session
             .query(cls.dag_id, cls.task_id, cls.execution_date)
             .filter(cls.dag_id == dag_id, cls.task_id == task_id)
             .order_by(cls.execution_date.desc())
             .limit(num_to_keep)
-            .subquery('subq1')
-        )
-
-        # Second Subquery
-        # Workaround for MySQL Limitation (https://stackoverflow.com/a/19344141/5691525)
-        # Limitation: This version of MySQL does not yet support
-        # LIMIT & IN/ALL/ANY/SOME subquery
-        subq2 = (
-            session
-            .query(subq1.c.dag_id, subq1.c.task_id, subq1.c.execution_date)
-            .subquery('subq2')
-        )
+        ).all()
+
+        filter_tis = [not_(and_(
+            cls.dag_id == ti.dag_id,
+            cls.task_id == ti.task_id,
+            cls.execution_date == ti.execution_date
+        )) for ti in tis_to_keep]
 
 Review comment:
   ```suggestion
           filter_tis = [not_(TI.filter_for_tis(tis_to_keep)]
   ```
   This may require a change in the filter_for_tis method. It will look something like the code below.
   ```python
       @staticmethod
       def filter_for_tis(
           tis: Iterable[Union["TaskInstance", TaskInstanceKeyType]]
       ) -> Optional[BooleanClauseList]:
           """Returns SQLAlchemy filter to query selected task instances"""
           TI = TaskInstance
           if not tis:
               return None
           if all(isinstance(t, tuple) for t in tis):
               if all(len(t) == 4 for t in tis):
                   filter_for_tis = [
                       and_(TI.dag_id == dag_id, TI.task_id == task_id, TI.execution_date == execution_date)
                       for dag_id, task_id, execution_date, _ in tis
                   ]
                   return or_(*filter_for_tis)
               if all(len(t) == 3 for t in tis):
                   filter_for_tis = [
                       and_(TI.dag_id == dag_id, TI.task_id == task_id, TI.execution_date == execution_date)
                       for dag_id, task_id, execution_date in tis
                   ]
                   return or_(*filter_for_tis)
               raise TypeError(
                   "All elements must have the same type: `TaskInstance`, `TaskInstanceKey` or "
                   "tuple[dag_id, task_id, execution_date]."
               )
   
           if all(isinstance(t, TaskInstance) for t in tis):
               filter_for_tis = ([and_(TI.dag_id == ti.dag_id,  # type: ignore
                                       TI.task_id == ti.task_id,  # type: ignore
                                       TI.execution_date == ti.execution_date)  # type: ignore
                                  for ti in tis])
               return or_(*filter_for_tis)
   
           raise TypeError(
               "All elements must have the same type: `TaskInstance`, `TaskInstanceKey` or "
               "tuple[dag_id, task_id, execution_date]."
           )
   
   ```

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.73%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.52%   -0.74%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39276     -325     
   - Misses       5783     6116     +333     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.25%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   87.00%   -0.26%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39493     -108     
   - Misses       5783     5899     +116     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [...viders/cncf/kubernetes/operators/kubernetes\_pod.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvY25jZi9rdWJlcm5ldGVzL29wZXJhdG9ycy9rdWJlcm5ldGVzX3BvZC5weQ==) | `69.69% <0.00%> (-25.26%)` | :arrow_down: |
   | [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0.00%> (-23.53%)` | :arrow_down: |
   | [airflow/jobs/backfill\_job.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9qb2JzL2JhY2tmaWxsX2pvYi5weQ==) | `90.52% <0.00%> (+0.27%)` | :arrow_up: |
   | [airflow/jobs/scheduler\_job.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9qb2JzL3NjaGVkdWxlcl9qb2IucHk=) | `90.94% <0.00%> (+0.43%)` | :arrow_up: |
   | [airflow/providers/postgres/hooks/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvaG9va3MvcG9zdGdyZXMucHk=) | `94.44% <0.00%> (+1.38%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.73%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.52%   -0.74%     
   ==========================================
     Files         935      935              
     Lines       45384    45392       +8     
   ==========================================
   - Hits        39601    39276     -325     
   - Misses       5783     6116     +333     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `92.85% <75.00%> (-2.98%)` | :arrow_down: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...6c07e56](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io commented on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #8051: [AIRFLOW-7045] Update SQL query to delete RenderedTaskInstanceFields
URL: https://github.com/apache/airflow/pull/8051#issuecomment-607588595
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=h1) Report
   > Merging [#8051](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/340e947d5db0ae1a5d5ca2d464fb78779acadc69&el=desc) will **decrease** coverage by `0.72%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/8051/graphs/tree.svg?width=650&height=150&src=pr&token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #8051      +/-   ##
   ==========================================
   - Coverage   87.25%   86.53%   -0.73%     
   ==========================================
     Files         935      935              
     Lines       45384    45384              
   ==========================================
   - Hits        39601    39271     -330     
   - Misses       5783     6113     +330     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/models/renderedtifields.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9tb2RlbHMvcmVuZGVyZWR0aWZpZWxkcy5weQ==) | `97.91% <100.00%> (+2.08%)` | :arrow_up: |
   | [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
   | [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
   | [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
   | [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
   | [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
   | [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
   | [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
   | [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/airflow/pull/8051/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=footer). Last update [340e947...e2c1c1f](https://codecov.io/gh/apache/airflow/pull/8051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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


With regards,
Apache Git Services