Skip to content

Commit 4dc5211

Browse files
committed
enforcing flake8 TC006 rule
1 parent e9cb9e8 commit 4dc5211

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

atlassian/jira.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _get_paged(
5656

5757
while True:
5858
response = cast(
59-
dict,
59+
"dict",
6060
super(Jira, self).get(
6161
url,
6262
trailing=trailing,
@@ -73,7 +73,7 @@ def _get_paged(
7373
if response.get("isLast", False) or len(values) == 0:
7474
break
7575

76-
url = cast(str, response.get("nextPage"))
76+
url = cast("str", response.get("nextPage"))
7777
if url is None:
7878
break
7979
# From now on we have absolute URLs with parameters
@@ -1484,7 +1484,7 @@ def issue_exists(self, issue_key: str) -> Optional[bool]:
14841484
original_value = self.advanced_mode
14851485
self.advanced_mode = True
14861486
try:
1487-
resp = cast(Response, self.issue(issue_key, fields="*none"))
1487+
resp = cast("Response", self.issue(issue_key, fields="*none"))
14881488
if resp.status_code == 404:
14891489
log.info('Issue "%s" does not exists', issue_key)
14901490
return False
@@ -1911,7 +1911,7 @@ def delete_issue_remote_link_by_id(self, issue_key: str, link_id: T_id) -> T_res
19111911

19121912
def get_issue_transitions(self, issue_key: str) -> List[dict]:
19131913
if self.advanced_mode:
1914-
resp = cast(Response, self.get_issue_transitions_full(issue_key))
1914+
resp = cast("Response", self.get_issue_transitions_full(issue_key))
19151915
d: Dict[str, list] = resp.json() or {}
19161916
else:
19171917
d = self.get_issue_transitions_full(issue_key) or {}
@@ -1922,7 +1922,7 @@ def get_issue_transitions(self, issue_key: str) -> List[dict]:
19221922
"id": int(transition["id"]),
19231923
"to": transition["to"]["name"],
19241924
}
1925-
for transition in cast(List[dict], d.get("transitions"))
1925+
for transition in cast("List[dict]", d.get("transitions"))
19261926
]
19271927

19281928
def issue_transition(self, issue_key: str, status: str) -> T_resp_json:
@@ -3074,25 +3074,25 @@ def get_project_issuekey_last(self, project: str):
30743074
jql = f'project = "{project}" ORDER BY issuekey DESC'
30753075
response = self.jql(jql)
30763076
if self.advanced_mode:
3077-
return cast(Response, response)
3077+
return cast("Response", response)
30783078

3079-
return (cast(dict, response).__getitem__("issues") or {"key": None})[0]["key"]
3079+
return (cast("dict", response).__getitem__("issues") or {"key": None})[0]["key"]
30803080

30813081
def get_project_issuekey_all(
30823082
self, project: str, start: int = 0, limit: Optional[int] = None, expand: Optional[str] = None
30833083
):
30843084
jql = f'project = "{project}" ORDER BY issuekey ASC'
30853085
response = self.jql(jql, start=start, limit=limit, expand=expand)
30863086
if self.advanced_mode:
3087-
return cast(Response, response)
3088-
return [issue["key"] for issue in cast(dict, response)["issues"]]
3087+
return cast("Response", response)
3088+
return [issue["key"] for issue in cast("dict", response)["issues"]]
30893089

30903090
def get_project_issues_count(self, project: str):
30913091
jql = f'project = "{project}" '
30923092
response = self.jql(jql, fields="*none")
30933093
if self.advanced_mode:
3094-
return cast(Response, response)
3095-
return cast(dict, response)["total"]
3094+
return cast("Response", response)
3095+
return cast("dict", response)["total"]
30963096

30973097
def get_all_project_issues(
30983098
self, project: str, fields: Union[str, List[str]] = "*all", start: int = 0, limit: Optional[int] = None
@@ -3108,8 +3108,8 @@ def get_all_project_issues(
31083108
jql = f'project = "{project}" ORDER BY key'
31093109
response = self.jql(jql, fields=fields, start=start, limit=limit)
31103110
if self.advanced_mode:
3111-
return cast(Response, response)
3112-
return cast(dict, response)["issues"]
3111+
return cast("Response", response)
3112+
return cast("dict", response)["issues"]
31133113

31143114
def get_all_assignable_users_for_project(self, project_key: str, start: int = 0, limit: int = 50):
31153115
"""

0 commit comments

Comments
 (0)