Skip to content

Commit d986520

Browse files
committed
Fix tests
1 parent ad62ed3 commit d986520

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ ignore =
8888
; Consider possible security implications associated with pickle module
8989
; Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
9090
S403, S301
91+
; Found too many imported names from a module
92+
WPS235
9193

9294
per-file-ignores =
9395
; all tests

taskiq_pipelines/steps/sequential.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Literal, Optional, Union
1+
from typing import Any, Dict, Optional, Union
22

33
import pydantic
44
from taskiq import AsyncBroker, AsyncTaskiqDecoratedTask, TaskiqResult
@@ -25,7 +25,17 @@ class SequentialStep(pydantic.BaseModel, AbstractStep, step_name="sequential"):
2525
additional_kwargs: Dict[str, Any]
2626

2727
@pydantic.validator("param_name")
28-
def validate_param_name(cls, value: Union[Optional[str], int]) -> Union[Optional[str], int]:
28+
def validate_param_name(
29+
self,
30+
value: Union[Optional[str], int],
31+
) -> Union[Optional[str], int]:
32+
"""
33+
Validate param_name.
34+
35+
:param value: value to validate.
36+
:raises ValueError: if value is not str, None or -1 (EMPTY_PARAM_NAME).
37+
:return: param value.
38+
"""
2939
if isinstance(value, int) and value != EMPTY_PARAM_NAME:
3040
raise ValueError("must be str, None or -1 (EMPTY_PARAM_NAME)")
3141
return value

0 commit comments

Comments
 (0)