Skip to content

Commit 618eafa

Browse files
committed
ci(mypy): fix no-redef and Optional narrowing in pulsar_transport
1 parent 9988c1a commit 618eafa

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/babelqueue/pulsar_transport.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ def _projection(body: str, route_urn: str = "") -> Dict[str, str]:
179179
gate = _parse_gate_route(route_urn)
180180
env = parse_envelope(body)
181181
if gate is not None:
182-
props = PulsarTransport._projection(body) if env else {}
183-
props["bq-schema-version"] = gate[0]
182+
gate_props: Dict[str, str] = PulsarTransport._projection(body) if env else {}
183+
gate_props["bq-schema-version"] = gate[0]
184184
if gate[1] is not None:
185-
props["bq-job"] = gate[1]
186-
return props
185+
gate_props["bq-job"] = gate[1]
186+
return gate_props
187187
if not env:
188188
return {}
189189
meta = env.get("meta") or {}
@@ -268,7 +268,7 @@ def _reconcile(
268268

269269
current = env.get("attempts")
270270
has_int_attempts = isinstance(current, int) and not isinstance(current, bool)
271-
attempts = current if has_int_attempts else 0
271+
attempts: int = current if isinstance(current, int) and has_int_attempts else 0
272272
from_property = PulsarTransport._parse_attempts(properties.get("bq-attempts"))
273273
if from_property is not None:
274274
attempts = from_property

0 commit comments

Comments
 (0)