You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "FrankYang0529 (via GitHub)" <gi...@apache.org> on 2026/06/14 10:36:17 UTC

[PR] [AIP-94] airflowctl jobs: add check command [airflow]

FrankYang0529 opened a new pull request, #68534:
URL: https://github.com/apache/airflow/pull/68534

   Add `airflowctl jobs check`.
    <!-- SPDX-License-Identifier: Apache-2.0
         https://www.apache.org/licenses/LICENSE-2.0 -->
   
   <!--
   Thank you for contributing!
   
   Please provide above a brief description of the changes made in this pull request.
   Write a good git commit message following this guide: http://chris.beams.io/posts/git-commit/
   
   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.
   
   For user-facing UI changes, please attach before/after screenshots (or a short
   screen recording) so reviewers can assess the visual impact.
   
   Feel free to ping (in general) for the review if you do not see reaction for a few days
   (72 Hours is the minimum reaction time you can expect from volunteers) - we sometimes miss notifications.
   
   In case of an existing issue, reference it using one of the following:
   
   * closes: #ISSUE
   * related: #ISSUE
   -->
   
   * related: #68402 
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, please
   change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
   -->
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: [Claude Code with Opus 4.8] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number.
   


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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

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


##########
airflow-ctl/src/airflowctl/ctl/commands/jobs_command.py:
##########
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import socket
+
+import rich
+
+from airflowctl.api.client import NEW_API_CLIENT, ClientKind, provide_api_client
+
+
+@provide_api_client(kind=ClientKind.CLI)
+def check(args, api_client=NEW_API_CLIENT) -> None:
+    """Check if job(s) are still alive."""
+    if args.allow_multiple and args.limit == 1:
+        raise SystemExit(
+            "To use option --allow-multiple, you must set the limit to a value greater than 1 "
+            "or 0 to disable it."
+        )
+    if args.hostname and args.local:
+        raise SystemExit("You can't use --hostname and --local at the same time")

Review Comment:
   Thanks for the review and suggestion. Updated 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.

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

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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

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


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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #68534:
URL: https://github.com/apache/airflow/pull/68534#discussion_r3643825604


##########
airflow-ctl/tests/airflow_ctl/ctl/commands/test_jobs_command.py:
##########
@@ -0,0 +1,136 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from types import SimpleNamespace
+from unittest import mock
+
+import pytest
+
+from airflowctl.ctl import cli_parser
+from airflowctl.ctl.commands import jobs_command
+
+
+def _make_jobs(count: int) -> SimpleNamespace:
+    """Build a stand-in for the ``JobCollectionResponse`` of ``count`` already-alive jobs."""
+    return SimpleNamespace(jobs=[SimpleNamespace(id=i) for i in range(count)])
+
+
+class TestCliJobsCheck:
+    parser = cli_parser.get_parser()
+
+    def test_reports_one_alive_job(self, capsys):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(1)
+
+        jobs_command.check(
+            self.parser.parse_args(["jobs", "check", "--job-type", "SchedulerJob"]),
+            api_client=api_client,
+        )
+
+        assert "Found one alive job." in capsys.readouterr().out
+        api_client.jobs.list.assert_called_once_with(job_type="SchedulerJob", hostname=None, is_alive=True)
+
+    def test_forwards_hostname(self, capsys):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(1)
+
+        jobs_command.check(
+            self.parser.parse_args(["jobs", "check", "--hostname", "HOSTNAME"]),
+            api_client=api_client,
+        )
+
+        api_client.jobs.list.assert_called_once_with(job_type=None, hostname="HOSTNAME", is_alive=True)
+
+    def test_reports_multiple_with_allow_multiple(self, capsys):

Review Comment:
   this can be merged with `test_reports_one_alive_job` through parameterize



##########
airflow-ctl/tests/airflow_ctl/ctl/commands/test_jobs_command.py:
##########
@@ -0,0 +1,136 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from types import SimpleNamespace
+from unittest import mock
+
+import pytest
+
+from airflowctl.ctl import cli_parser
+from airflowctl.ctl.commands import jobs_command
+
+
+def _make_jobs(count: int) -> SimpleNamespace:
+    """Build a stand-in for the ``JobCollectionResponse`` of ``count`` already-alive jobs."""
+    return SimpleNamespace(jobs=[SimpleNamespace(id=i) for i in range(count)])
+
+
+class TestCliJobsCheck:
+    parser = cli_parser.get_parser()
+
+    def test_reports_one_alive_job(self, capsys):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(1)
+
+        jobs_command.check(
+            self.parser.parse_args(["jobs", "check", "--job-type", "SchedulerJob"]),
+            api_client=api_client,
+        )
+
+        assert "Found one alive job." in capsys.readouterr().out
+        api_client.jobs.list.assert_called_once_with(job_type="SchedulerJob", hostname=None, is_alive=True)
+
+    def test_forwards_hostname(self, capsys):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(1)
+
+        jobs_command.check(
+            self.parser.parse_args(["jobs", "check", "--hostname", "HOSTNAME"]),
+            api_client=api_client,
+        )
+
+        api_client.jobs.list.assert_called_once_with(job_type=None, hostname="HOSTNAME", is_alive=True)
+
+    def test_reports_multiple_with_allow_multiple(self, capsys):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(3)
+
+        jobs_command.check(
+            self.parser.parse_args(["jobs", "check", "--limit", "100", "--allow-multiple"]),
+            api_client=api_client,
+        )
+
+        assert "Found 3 alive jobs." in capsys.readouterr().out
+
+    def test_no_alive_jobs(self):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(0)
+
+        with pytest.raises(SystemExit, match=r"No alive jobs found."):
+            jobs_command.check(self.parser.parse_args(["jobs", "check"]), api_client=api_client)
+
+    def test_multiple_without_allow_multiple_fails(self):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(3)
+
+        with pytest.raises(SystemExit, match=r"Found 3 alive jobs. Expected only one."):
+            jobs_command.check(
+                self.parser.parse_args(["jobs", "check", "--limit", "100"]), api_client=api_client
+            )

Review Comment:
   same for these



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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

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


##########
airflow-ctl/src/airflowctl/ctl/commands/jobs_command.py:
##########
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import socket
+
+import rich
+
+from airflowctl.api.client import NEW_API_CLIENT, ClientKind, provide_api_client
+
+
+@provide_api_client(kind=ClientKind.CLI)
+def check(args, api_client=NEW_API_CLIENT) -> None:
+    """Check if job(s) are still alive."""
+    if args.allow_multiple and args.limit <= 1:
+        raise SystemExit("To use option --allow-multiple, you must set the limit to a value greater than 1.")

Review Comment:
   Hi, as far as I understand, `--allow-multiple` can be used like this, right?
   `airflowctl jobs check --job-type TriggererJob --limit 3 --allow-multiple`
   
   Since `--limit 0` means disabling the limit / checking all matching jobs, I think this should also work:
   `airflowctl jobs check --job-type TriggererJob --limit 0 --allow-multiple`
   
   Should we change the condition from `args.limit <= 1` to `args.limit == 1`?



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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #68534:
URL: https://github.com/apache/airflow/pull/68534#issuecomment-5213598341

   ### Backport failed to create: airflow-ctl/v0-1-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/31155629804'> Run details </a>
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
   
   In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
       <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>❌</td>
           <td>airflow-ctl/v0-1-test</td>
           <td><a href="https://github.com/apache/airflow/commit/61f028989c027a240a7a10c47a81f6cdce9cdd8a"><img src='https://img.shields.io/badge/Commit-61f0289-red' alt='Commit Link'></a></td>
       </tr>
   </table>
   
   You can attempt to backport this manually by running:
   
   ```bash
   cherry_picker 61f0289 airflow-ctl/v0-1-test
   ```
   
   This should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking
   the files that need manual conflict resolution.
   
   After you have resolved the conflicts, you can continue the backport process by running:
   
   ```bash
   cherry_picker --continue
   ```
   
   If you don't have cherry-picker installed, see the [installation guide](https://github.com/apache/airflow/blob/main/dev/README.md#how-to-backport-pr-with-cherry-picker-cli).
   


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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #68534:
URL: https://github.com/apache/airflow/pull/68534#discussion_r3623057791


##########
airflow-ctl/tests/airflow_ctl/ctl/commands/test_jobs_command.py:
##########
@@ -0,0 +1,136 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from types import SimpleNamespace
+from unittest import mock
+
+import pytest
+
+from airflowctl.ctl import cli_parser
+from airflowctl.ctl.commands import jobs_command
+
+
+def _jobs(count: int) -> SimpleNamespace:

Review Comment:
   make it a fixture maybe? doesn't look like a function name



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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

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


##########
airflow-ctl/src/airflowctl/ctl/commands/jobs_command.py:
##########
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import socket
+
+import rich
+
+from airflowctl.api.client import NEW_API_CLIENT, ClientKind, provide_api_client
+
+
+@provide_api_client(kind=ClientKind.CLI)
+def check(args, api_client=NEW_API_CLIENT) -> None:
+    """Check if job(s) are still alive."""
+    if args.allow_multiple and args.limit == 1:
+        raise SystemExit(
+            "To use option --allow-multiple, you must set the limit to a value greater than 1 "
+            "or 0 to disable it."
+        )
+    if args.hostname and args.local:
+        raise SystemExit("You can't use --hostname and --local at the same time")

Review Comment:
   ```suggestion
           raise SystemExit("You can't use --hostname and --local at the same time.")
   ```
   



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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

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


##########
airflow-ctl/tests/airflow_ctl/ctl/commands/test_jobs_command.py:
##########
@@ -0,0 +1,136 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from types import SimpleNamespace
+from unittest import mock
+
+import pytest
+
+from airflowctl.ctl import cli_parser
+from airflowctl.ctl.commands import jobs_command
+
+
+def _make_jobs(count: int) -> SimpleNamespace:
+    """Build a stand-in for the ``JobCollectionResponse`` of ``count`` already-alive jobs."""
+    return SimpleNamespace(jobs=[SimpleNamespace(id=i) for i in range(count)])
+
+
+class TestCliJobsCheck:
+    parser = cli_parser.get_parser()
+
+    def test_reports_one_alive_job(self, capsys):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(1)
+
+        jobs_command.check(
+            self.parser.parse_args(["jobs", "check", "--job-type", "SchedulerJob"]),
+            api_client=api_client,
+        )
+
+        assert "Found one alive job." in capsys.readouterr().out
+        api_client.jobs.list.assert_called_once_with(job_type="SchedulerJob", hostname=None, is_alive=True)
+
+    def test_forwards_hostname(self, capsys):
+        api_client = mock.MagicMock()
+        api_client.jobs.list.return_value = _make_jobs(1)
+
+        jobs_command.check(
+            self.parser.parse_args(["jobs", "check", "--hostname", "HOSTNAME"]),
+            api_client=api_client,
+        )
+
+        api_client.jobs.list.assert_called_once_with(job_type=None, hostname="HOSTNAME", is_alive=True)
+
+    def test_reports_multiple_with_allow_multiple(self, capsys):

Review Comment:
   Refactored the test file to 4 groups. Thanks for the review.



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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

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


##########
airflow-ctl/tests/airflow_ctl/ctl/commands/test_jobs_command.py:
##########
@@ -0,0 +1,136 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from types import SimpleNamespace
+from unittest import mock
+
+import pytest
+
+from airflowctl.ctl import cli_parser
+from airflowctl.ctl.commands import jobs_command
+
+
+def _jobs(count: int) -> SimpleNamespace:

Review Comment:
   Change it to `_make_jobs`. Thank you.



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


Re: [PR] [AIP-94] airflowctl jobs: add check command [airflow]

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


##########
airflow-ctl/src/airflowctl/ctl/commands/jobs_command.py:
##########
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import socket
+
+import rich
+
+from airflowctl.api.client import NEW_API_CLIENT, ClientKind, provide_api_client
+
+
+@provide_api_client(kind=ClientKind.CLI)
+def check(args, api_client=NEW_API_CLIENT) -> None:
+    """Check if job(s) are still alive."""
+    if args.allow_multiple and args.limit <= 1:
+        raise SystemExit("To use option --allow-multiple, you must set the limit to a value greater than 1.")

Review Comment:
   Good catch! Thanks for the review. Changed to condition to `args.limit == 1`. Since `airflow jobs check` will be deprecated, I don't change logic there.



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