Skip to content

Commit

Permalink
using Union instead of | type operand
Browse files Browse the repository at this point in the history
  • Loading branch information
lnxpy committed Nov 21, 2024
1 parent d83138a commit 066eeae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions pyaction/issues/connector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

import requests

from pyaction.issues.rendering import IssueTemplate
Expand All @@ -6,25 +8,27 @@


class IssueForm:
def __init__(self, repository: str, number: int, token: str | None = None) -> None:
def __init__(
self, repository: str, number: int, token: Optional[str] = None
) -> None:
"""
initializer
Initializer.
Args:
repository (str): repository name in the form of username/repository
number (int): issue number/ID
token (str, optional): GITHUB_TOKEN token. Defaults to None.
repository (str): Repository name in the form of username/repository.
number (int): Issue number/ID.
token (Optional[str]): `GITHUB_TOKEN` token. Defaults to None.
"""
self._token = token
self.repository = repository
self.number = number

def render(self) -> dict[str, str]:
"""
renders the issue body
Renders the issue body.
Returns:
OrderedDict: the issue body in form of dictionary
Returns the issue body in form of dictionary.
"""
headers = {"Accept": "application/vnd.github+json"}

Expand Down
4 changes: 2 additions & 2 deletions pyaction/workflow/stream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from typing import Dict, NewType
from typing import Dict, NewType, Union

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

DELIMITER: str = "EOF"

Expand Down

0 comments on commit 066eeae

Please sign in to comment.