Skip to content

Commit 116f987

Browse files
Broaden operation-name helper typing to object components
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 814e135 commit 116f987

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

hyperbrowser/client/polling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _validate_operation_name(operation_name: str) -> None:
7676
raise HyperbrowserError("operation_name must not contain control characters")
7777

7878

79-
def build_operation_name(prefix: str, identifier: str) -> str:
79+
def build_operation_name(prefix: object, identifier: object) -> str:
8080
normalized_prefix = _coerce_operation_name_component(prefix, fallback="")
8181
raw_identifier = _coerce_operation_name_component(identifier, fallback="unknown")
8282
normalized_identifier = raw_identifier.strip()

tests/test_polling.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_build_operation_name_uses_unknown_for_blank_identifier():
8686
def test_build_operation_name_supports_non_string_identifier_values():
8787
operation_name = build_operation_name(
8888
"crawl job ",
89-
123, # type: ignore[arg-type]
89+
123,
9090
)
9191

9292
assert operation_name == "crawl job 123"
@@ -99,7 +99,7 @@ def __str__(self) -> str:
9999

100100
operation_name = build_operation_name(
101101
"crawl job ",
102-
_BadIdentifier(), # type: ignore[arg-type]
102+
_BadIdentifier(),
103103
)
104104

105105
assert operation_name == "crawl job unknown"
@@ -111,7 +111,7 @@ def __str__(self) -> str:
111111
raise RuntimeError("cannot stringify")
112112

113113
operation_name = build_operation_name(
114-
_BadPrefix(), # type: ignore[arg-type]
114+
_BadPrefix(),
115115
"identifier",
116116
)
117117

0 commit comments

Comments
 (0)