Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async def probe(engine: AsyncEngine, table_name: str, schema: str | None = None)

yield sink

checked_out = engine.pool.checkedout() # ty: ignore[unresolved-attribute]
checked_out = engine.pool.checkedout() # ty: ignore[missing-attribute]
if checked_out:
msg = (
f"{checked_out} connection(s) are still checked out of the pool. "
Expand Down
8 changes: 4 additions & 4 deletions faststream_outbox/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class OutboxBroker(

# P25: the runtime container is a WeakSet (set by the upstream Registrator), not a
# list — annotate it accurately so the _subscribers/subscribers distinction is clear.
_subscribers: "WeakSet[OutboxSubscriber]" # ty: ignore[invalid-attribute-override]
_subscribers: "WeakSet[OutboxSubscriber]" # ty: ignore[incompatible-attribute-override]

def __init__( # noqa: PLR0913
self,
Expand Down Expand Up @@ -324,7 +324,7 @@ def _warn_on_unstarted_foreign_publishers(self) -> None:
for sub in self.subscribers:
for call in sub.calls:
for pub in call.handler._publishers: # noqa: SLF001
outer = pub._outer_config # noqa: SLF001 # ty: ignore[unresolved-attribute]
outer = pub._outer_config # noqa: SLF001 # ty: ignore[missing-attribute]
# An internal outbox publisher's ``outer`` is this broker's own config,
# which carries a (truthy) ``producer`` — so the wired-producer check
# below already skips it; no separate ``outer is self.config`` branch needed.
Expand Down Expand Up @@ -434,7 +434,7 @@ async def validate_schema(self, *, check_autovacuum: bool = False) -> None:
await self.client.validate_schema(check_autovacuum=check_autovacuum)

# Deliberate signature divergence: the outbox contract adds session/activate_*/timer_id.
async def publish( # ty: ignore[invalid-method-override]
async def publish( # ty: ignore[incompatible-method-override]
self,
body: typing.Any,
*,
Expand Down Expand Up @@ -486,7 +486,7 @@ async def publish( # ty: ignore[invalid-method-override]
return typing.cast("int | None", result)

# Deliberate signature divergence: the outbox contract adds session/activate_*.
async def publish_batch( # ty: ignore[invalid-method-override]
async def publish_batch( # ty: ignore[incompatible-method-override]
self,
*bodies: typing.Any,
queue: str,
Expand Down
2 changes: 1 addition & 1 deletion faststream_outbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ async def cancel_timer(self, *, queue: str, timer_id: str, session: SessionOrCon
t.c.acquired_token.is_(None),
)
result = await session.execute(stmt)
return (result.rowcount or 0) > 0 # ty: ignore[unresolved-attribute]
return (result.rowcount or 0) > 0 # ty: ignore[missing-attribute]

async def fetch_unprocessed(
self,
Expand Down
6 changes: 3 additions & 3 deletions faststream_outbox/fastapi/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class OutboxRouter(StreamRouter[OutboxInnerMessage]):
"""FastAPI router for the outbox transport."""

broker_class = _OutboxBroker
broker: _OutboxBroker # ty: ignore[invalid-mutable-override]
broker: _OutboxBroker # ty: ignore[incompatible-mutable-override]

def __init__( # noqa: PLR0913
self,
Expand Down Expand Up @@ -156,7 +156,7 @@ def __init__( # noqa: PLR0913
generate_unique_id_function=generate_unique_id_function,
)

def subscriber( # ty: ignore[invalid-method-override] # noqa: PLR0913
def subscriber( # ty: ignore[incompatible-method-override] # noqa: PLR0913
self,
queues: str | list[str],
*,
Expand Down Expand Up @@ -222,7 +222,7 @@ def subscriber( # ty: ignore[invalid-method-override] # noqa: PLR0913
),
)

def publisher( # ty: ignore[invalid-method-override]
def publisher( # ty: ignore[incompatible-method-override]
self,
queue: str,
*,
Expand Down
2 changes: 1 addition & 1 deletion faststream_outbox/publisher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@dataclass(kw_only=True)
class OutboxPublisherConfig(PublisherUsecaseConfig):
_outer_config: "OutboxBrokerConfig" # ty: ignore[invalid-mutable-override]
_outer_config: "OutboxBrokerConfig" # ty: ignore[incompatible-mutable-override]
queue: str
headers: dict[str, str] | None = None

Expand Down
4 changes: 2 additions & 2 deletions faststream_outbox/publisher/usecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
class OutboxPublisher(PublisherUsecase):
"""Queue-scoped publisher. Standalone use only — no relay decorator support."""

_outer_config: "OutboxBrokerConfig" # ty: ignore[invalid-mutable-override]
_outer_config: "OutboxBrokerConfig" # ty: ignore[incompatible-mutable-override]

def __init__(
self,
Expand All @@ -65,7 +65,7 @@ def __call__(
) -> "HandlerCallWrapper[P_HandlerParams, T_HandlerReturn]":
raise NotImplementedError(_REJECT_RELAY_MSG)

async def publish( # ty: ignore[invalid-method-override]
async def publish( # ty: ignore[incompatible-method-override]
self,
body: typing.Any, # parity with broker.publish (both build OutboxPublishCommand(body: Any))
*,
Expand Down
4 changes: 2 additions & 2 deletions faststream_outbox/registrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class OutboxRegistrator(Registrator[OutboxInnerMessage, "OutboxBrokerConfig"]): # ty: ignore[unresolved-reference]
@override
def subscriber( # ty: ignore[invalid-method-override]
def subscriber( # ty: ignore[incompatible-method-override]
self,
queues: str | list[str],
*,
Expand Down Expand Up @@ -108,7 +108,7 @@ def include_router(
)

@override
def publisher( # ty: ignore[invalid-method-override]
def publisher( # ty: ignore[incompatible-method-override]
self,
queue: str,
*,
Expand Down
2 changes: 1 addition & 1 deletion faststream_outbox/subscriber/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _validate_queues(queues: list[str]) -> None:

@dataclass(kw_only=True)
class OutboxSubscriberConfig(SubscriberUsecaseConfig):
_outer_config: "OutboxBrokerConfig" # ty: ignore[invalid-mutable-override]
_outer_config: "OutboxBrokerConfig" # ty: ignore[incompatible-mutable-override]
queues: list[str]
max_workers: int
retry_strategy: "RetryStrategyProto | None"
Expand Down
6 changes: 3 additions & 3 deletions faststream_outbox/subscriber/usecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def get_schema(self) -> dict[str, SubscriberSpec]:


class OutboxSubscriber(TasksMixin, SubscriberUsecase[OutboxInnerMessage]):
_outer_config: "OutboxBrokerConfig" # ty: ignore[invalid-mutable-override]
_outer_config: "OutboxBrokerConfig" # ty: ignore[incompatible-mutable-override]

def __init__(
self,
Expand Down Expand Up @@ -1108,7 +1108,7 @@ async def process_message(self, msg: OutboxInnerMessage) -> "Response": # noqa:
stack.enter_context(context.scope(k, v))

middlewares: list[typing.Any] = []
for base_m in self._SubscriberUsecase__build__middlewares_stack(): # ty: ignore[unresolved-attribute]
for base_m in self._SubscriberUsecase__build__middlewares_stack(): # ty: ignore[missing-attribute]
middleware = base_m(msg, context=context)
middlewares.append(middleware)
await middleware.__aenter__()
Expand Down Expand Up @@ -1146,7 +1146,7 @@ async def process_message(self, msg: OutboxInnerMessage) -> "Response": # noqa:
self._reject_outbox_response_with_foreign_publisher(result_msg, h.handler)

for p in chain(
self._SubscriberUsecase__get_response_publisher(message), # ty: ignore[unresolved-attribute]
self._SubscriberUsecase__get_response_publisher(message), # ty: ignore[missing-attribute]
h.handler._publishers, # noqa: SLF001
):
await p._publish( # noqa: SLF001
Expand Down
2 changes: 1 addition & 1 deletion tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ async def handle(body: dict) -> None: ...
assert all(s not in broker._subscribers for s in subs) # noqa: SLF001
done_task = MagicMock()
done_task.done.return_value = True
subs[0].tasks = [done_task] # ty: ignore[unresolved-attribute]
subs[0].tasks = [done_task] # ty: ignore[missing-attribute]
assert await broker.ping() is False


Expand Down
Loading