Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #19110: Implement job to copy mis-placed translation images #21378

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix type annotations in JobRunResult
The as_stdout() and as_stderr() functions were annotated as only
accepting str and int arguments, but they are designed (and frequently
used) to process arbitrary input types. Therefore, they should actually
accept inputs of type Any.
  • Loading branch information
U8NWXD committed Dec 9, 2024
commit 2c9314efa311dcd7822ce8c3c625cba1e6d78049
8 changes: 6 additions & 2 deletions core/jobs/types/job_run_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def __init__(self, stdout: str = '', stderr: str = ''):

@classmethod
def as_stdout(
cls, value: Union[str, int], use_repr: bool = False
# NOTE: Here we use type Any because this function can operate on inputs
# of any type.
cls, value: Any, use_repr: bool = False
) -> JobRunResult:
"""Returns a new JobRunResult with a stdout value.

Expand All @@ -83,7 +85,9 @@ def as_stdout(

@classmethod
def as_stderr(
cls, value: Union[str, int], use_repr: bool = False
# NOTE: Here we use type Any because this function can operate on inputs
# of any type.
cls, value: Any, use_repr: bool = False
) -> JobRunResult:
"""Returns a new JobRunResult with a stderr value.

Expand Down