Skip to content

Commit

Permalink
Fix the type checking for Ci (#1678)
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
zelinh authored Mar 1, 2022
1 parent a0e25d8 commit 9cb1ffb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ci_workflow/ci_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import re
from io import TextIOWrapper
from typing import Any
from typing import Type, Union

from ci_workflow.ci_args import CiArgs
from ci_workflow.ci_input_manifest import CiInputManifest
Expand All @@ -16,12 +16,12 @@

class CiManifests:
@staticmethod
def __klass(filename: str) -> Any:
def __klass(filename: str) -> Union[Type[CiTestManifest], Type[CiInputManifest]]:
if re.search("-test.yml$", filename):
return CiTestManifest
else:
return CiInputManifest

@classmethod
def from_file(cls, file: TextIOWrapper, args: CiArgs) -> Any:
def from_file(cls, file: TextIOWrapper, args: CiArgs) -> Union[CiTestManifest, CiInputManifest]:
return cls.__klass(file.name)(file, args)

0 comments on commit 9cb1ffb

Please sign in to comment.