- example.py: mark the base Example.scope field frozen so the (#7798)

Literal[api]/Literal[python] subclass overrides are covariant
  read-only narrowings. Subclass fields stay writable at runtime.
- method_definition.py, options_chains.py: pydantic 2.14 types
  FieldInfo.annotation as TypeForm[Any] | None, which ty rejects in
  Union[]/Annotated[] and where  is expected; bind it as Any.
  Use FieldInfo.get_default(call_default_factory=True) instead of
  calling the default_factory union directly.
- economy_views.py: read data/obbject_item without None defaults in the
  IMF shipping views. charting always sets obbject_item, and data is
  only popped when present and not None.- finra, jodi, eia: annotate @asynccontextmanager/@contextmanager
  functions with AsyncGenerator/Generator instead of the deprecated
  AsyncIterator/Iterator return types.
- charting: cast the darts forecast dataset to TimeSeries before
  indexing so .all_values resolves instead of hitting ndarray.
- fred, imf, nasdaq, sec, tmx: turn off invalid-attribute-override and
  invalid-mutable-override for models/** only, following the cboe
  precedent. Provider models extend the standard models by narrowing
  query params to Literals or widening fields to Optional, which these
  rules flag by design.

Co-authored-by: dlee-bq <325002271+dlee-bq@users.noreply.github.com>
This commit is contained in:
dlee-bq
2026-10-17 20:50:39 +00:00
committed by GitHub
parent d67b32e2f9
commit 7f04334398
13 changed files with 55 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
"""HTTP transport for the FINRA data services."""
from collections.abc import AsyncIterator, Awaitable, Callable
from collections.abc import AsyncGenerator, Awaitable, Callable
from contextlib import asynccontextmanager
from typing import Any
@@ -243,7 +243,7 @@ class QueryApiSession:
@asynccontextmanager
async def query_api_session() -> AsyncIterator[QueryApiSession]:
async def query_api_session() -> AsyncGenerator[QueryApiSession, None]:
"""Open a session on the public FINRA Query API.
Yields
@@ -412,7 +412,7 @@ async def _trace_token(session: Any) -> str:
@asynccontextmanager
async def trace_session() -> AsyncIterator[TraceSession]:
async def trace_session() -> AsyncGenerator[TraceSession, None]:
"""Open a session on the public TRACE data service.
Yields
@@ -590,7 +590,7 @@ class MarketDataSession:
@asynccontextmanager
async def market_data_session() -> AsyncIterator[MarketDataSession]:
async def market_data_session() -> AsyncGenerator[MarketDataSession, None]:
"""Open a seeded session on the FINRA Market Data Center.
Yields