Skip to content

Commit cbdc9e1

Browse files
committed
Fix type errors
1 parent f374f83 commit cbdc9e1

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

reportportal_client/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
else:
2424
from typing_extensions import Unpack
2525

26-
import aenum
26+
import aenum # type: ignore
2727

2828
# noinspection PyProtectedMember
2929
from reportportal_client._internal.local import current, set_current
@@ -43,9 +43,6 @@ class ClientType(aenum.Enum):
4343

4444

4545
class _ClientOptions(TypedDict, total=False):
46-
client_type: ClientType
47-
endpoint: str
48-
project: str
4946
api_key: Optional[str]
5047
# OAuth 2.0 parameters
5148
oauth_uri: Optional[str]
@@ -122,15 +119,16 @@ def create_client(
122119
:return: ReportPortal Client instance.
123120
"""
124121
my_kwargs = kwargs.copy()
125-
if "log_batch_payload_size" in my_kwargs:
122+
if "log_batch_payload_size" in my_kwargs: # type: ignore
126123
warnings.warn(
127124
message="Your agent is using `log_batch_payload_size` property which was introduced by mistake. "
128125
"The real property name is `log_batch_payload_limit`. Please consider Agent version update.",
129126
category=DeprecationWarning,
130127
stacklevel=2,
131128
)
129+
payload_size = my_kwargs.pop("log_batch_payload_size") # type: ignore
132130
if "log_batch_payload_limit" not in my_kwargs:
133-
my_kwargs["log_batch_payload_limit"] = my_kwargs.pop("log_batch_payload_size")
131+
my_kwargs["log_batch_payload_limit"] = payload_size
134132

135133
if client_type is ClientType.SYNC:
136134
return RPClient(endpoint, project, **my_kwargs)

reportportal_client/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class RPClient(RP):
387387
base_url_v2: str
388388
__endpoint: str
389389
is_skipped_an_issue: bool
390-
__launch_uuid: str
390+
__launch_uuid: Optional[str]
391391
use_own_launch: bool
392392
log_batch_size: int
393393
log_batch_payload_limit: int
@@ -468,7 +468,7 @@ def __init__(
468468
verify_ssl: Union[bool, str] = True,
469469
retries: int = None,
470470
max_pool_size: int = 50,
471-
launch_uuid: str = None,
471+
launch_uuid: Optional[str] = None,
472472
http_timeout: Union[float, tuple[float, float]] = (10, 10),
473473
log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE,
474474
mode: str = "DEFAULT",
@@ -522,7 +522,7 @@ def __init__(
522522
self.is_skipped_an_issue = is_skipped_an_issue
523523
self.__launch_uuid = launch_uuid
524524
if not self.__launch_uuid:
525-
launch_id = kwargs.get("launch_id")
525+
launch_id = kwargs.get("launch_id") # type: ignore
526526
if launch_id:
527527
warnings.warn(
528528
message="`launch_id` property is deprecated since 5.5.0 and will be subject for removing"

0 commit comments

Comments
 (0)