You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/06/26 20:22:18 UTC

[GitHub] [airflow] hussein-awala opened a new pull request, #32155: Add an option to `GlueJobOperator` to stop the job run when the TI is killed

hussein-awala opened a new pull request, #32155:
URL: https://github.com/apache/airflow/pull/32155

   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   closes: #32137
   
   This PR adds a new boolean parameter `stop_job_run_on_kill`  to `GlueJobOperator`, when it is set to `True`, the Glue job run will be stopped if the TI is killed (because of a timeout or a SIGTERM/clear).
   
   ---
   **^ 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 changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+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 a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] vincbeck commented on a diff in pull request #32155: Add an option to `GlueJobOperator` to stop the job run when the TI is killed

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #32155:
URL: https://github.com/apache/airflow/pull/32155#discussion_r1243902976


##########
airflow/providers/amazon/aws/operators/glue.py:
##########
@@ -123,12 +125,11 @@ def __init__(
         self.update_config = update_config
         self.deferrable = deferrable
         self.job_poll_interval = job_poll_interval
+        self.stop_job_run_on_kill = stop_job_run_on_kill
+        self._job_run_id: str | None = None
 
-    def execute(self, context: Context):
-        """Execute AWS Glue Job from Airflow.
-
-        :return: the current Glue job ID.
-        """
+    @cached_property
+    def glue_job(self) -> GlueJobHook:

Review Comment:
   ```suggestion
       def glue_job_hook(self) -> GlueJobHook:
   ```



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] o-nikolas commented on a diff in pull request #32155: Add an option to `GlueJobOperator` to stop the job run when the TI is killed

Posted by "o-nikolas (via GitHub)" <gi...@apache.org>.
o-nikolas commented on code in PR #32155:
URL: https://github.com/apache/airflow/pull/32155#discussion_r1244175403


##########
airflow/providers/amazon/aws/operators/glue.py:
##########
@@ -100,6 +101,7 @@ def __init__(
         verbose: bool = False,
         update_config: bool = False,
         job_poll_interval: int | float = 6,
+        stop_job_run_on_kill: bool = False,

Review Comment:
   Can you add a `:param stop_job_run_on_kill: ...` description to the method doc string please?



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] vincbeck merged pull request #32155: Add an option to `GlueJobOperator` to stop the job run when the TI is killed

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck merged PR #32155:
URL: https://github.com/apache/airflow/pull/32155


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] hussein-awala commented on pull request #32155: Add an option to `GlueJobOperator` to stop the job run when the TI is killed

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on PR #32155:
URL: https://github.com/apache/airflow/pull/32155#issuecomment-1610194653

   @vincbeck @o-nikolas Thank you for your suggestion. Could you please take a second look?


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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