Skip to content

Commit a91a303

Browse files
chore: add type-hints to gitlab/v4/objects/sidekiq.py
1 parent 8da0b75 commit a91a303

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

gitlab/v4/objects/sidekiq.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
from typing import Any, Dict, Union
2+
3+
import requests
4+
15
from gitlab import cli
26
from gitlab import exceptions as exc
37
from gitlab.base import RESTManager
@@ -16,7 +20,7 @@ class SidekiqManager(RESTManager):
1620

1721
@cli.register_custom_action("SidekiqManager")
1822
@exc.on_http_error(exc.GitlabGetError)
19-
def queue_metrics(self, **kwargs):
23+
def queue_metrics(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
2024
"""Return the registered queues information.
2125
2226
Args:
@@ -33,7 +37,9 @@ def queue_metrics(self, **kwargs):
3337

3438
@cli.register_custom_action("SidekiqManager")
3539
@exc.on_http_error(exc.GitlabGetError)
36-
def process_metrics(self, **kwargs):
40+
def process_metrics(
41+
self, **kwargs: Any
42+
) -> Union[Dict[str, Any], requests.Response]:
3743
"""Return the registered sidekiq workers.
3844
3945
Args:
@@ -50,7 +56,7 @@ def process_metrics(self, **kwargs):
5056

5157
@cli.register_custom_action("SidekiqManager")
5258
@exc.on_http_error(exc.GitlabGetError)
53-
def job_stats(self, **kwargs):
59+
def job_stats(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
5460
"""Return statistics about the jobs performed.
5561
5662
Args:
@@ -67,7 +73,9 @@ def job_stats(self, **kwargs):
6773

6874
@cli.register_custom_action("SidekiqManager")
6975
@exc.on_http_error(exc.GitlabGetError)
70-
def compound_metrics(self, **kwargs):
76+
def compound_metrics(
77+
self, **kwargs: Any
78+
) -> Union[Dict[str, Any], requests.Response]:
7179
"""Return all available metrics and statistics.
7280
7381
Args:

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module = [
1414
"docs.ext.*",
1515
"gitlab.v4.objects.files",
1616
"gitlab.v4.objects.labels",
17-
"gitlab.v4.objects.sidekiq",
1817
"tests.functional.*",
1918
"tests.functional.api.*",
2019
"tests.meta.*",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy