Skip to content

[BugFix] Fix TY Check Failures Raised by TY 0.0.89 - #7798

Merged
deeleeramone merged 1 commit into
developfrom
bugfix/fix-ty-new-rules
Oct 17, 2026
Merged

deeleeramone merged 1 commit into
developfrom
bugfix/fix-ty-new-rules

Conversation

@dlee-bq

@dlee-bq dlee-bq commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

This PR fixes lint failures from ty 0.0.89. The CI installs the latest ty (devtools pins ty>=0.0.40), which moved from 0.0.84 to 0.0.89. The new release enables invalid-mutable-override by default, checks attribute override types, reports deprecated overloads used as decorators, and exits 1 on warning-level diagnostics.

  • example.py: mark the base Example.scope field frozen so theLiteral[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.

  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.
@dlee-bq dlee-bq added the bug Bugs and bug fixes label Oct 17, 2026
@deeleeramone
deeleeramone added this pull request to the merge queue Oct 17, 2026
Merged via the queue into develop with commit 7f04334 Oct 17, 2026
142 checks passed
@deeleeramone
deeleeramone deleted the bugfix/fix-ty-new-rules branch October 17, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bugs and bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants