Skip to content

Commit 066eeae

Browse files
committed
using Union instead of | type operand
1 parent d83138a commit 066eeae

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pyaction/issues/connector.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Optional
2+
13
import requests
24

35
from pyaction.issues.rendering import IssueTemplate
@@ -6,25 +8,27 @@
68

79

810
class IssueForm:
9-
def __init__(self, repository: str, number: int, token: str | None = None) -> None:
11+
def __init__(
12+
self, repository: str, number: int, token: Optional[str] = None
13+
) -> None:
1014
"""
11-
initializer
15+
Initializer.
1216
1317
Args:
14-
repository (str): repository name in the form of username/repository
15-
number (int): issue number/ID
16-
token (str, optional): GITHUB_TOKEN token. Defaults to None.
18+
repository (str): Repository name in the form of username/repository.
19+
number (int): Issue number/ID.
20+
token (Optional[str]): `GITHUB_TOKEN` token. Defaults to None.
1721
"""
1822
self._token = token
1923
self.repository = repository
2024
self.number = number
2125

2226
def render(self) -> dict[str, str]:
2327
"""
24-
renders the issue body
28+
Renders the issue body.
2529
2630
Returns:
27-
OrderedDict: the issue body in form of dictionary
31+
Returns the issue body in form of dictionary.
2832
"""
2933
headers = {"Accept": "application/vnd.github+json"}
3034

pyaction/workflow/stream.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
2-
from typing import Dict, NewType
2+
from typing import Dict, NewType, Union
33

4-
WorkflowContext = NewType("WorkflowContext", Dict[str, int | float | str | bool])
4+
WorkflowContext = NewType("WorkflowContext", Dict[str, Union[int, float, str, bool]])
55

66
DELIMITER: str = "EOF"
77

0 commit comments

Comments
 (0)