Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(typing): Fully annotate api.py #3508

Merged
merged 23 commits into from
Aug 2, 2024
Merged

Commits on Jul 28, 2024

  1. ci(ruff): Add ANN rules for api.py only

    To highlight all the missing annotations to fix and autofix `None` return
    dangotbanned committed Jul 28, 2024
    Configuration menu
    Copy the full SHA
    fde0696 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. feat(typing): Complete annotations for most api functions

    Excluding `*args` on `ChartType` wrappers. They need to be defined in alignment in multiple places, which is more complex
    dangotbanned committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    cb1707e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a32c937 View commit details
    Browse the repository at this point in the history
  3. feat(typing): Various changes to enforce dict[str, Any] instead of …

    …`dict`
    
    Among these, many locations already assume `str` keys in the implementation - without checking
    dangotbanned committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    de2fe9f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    20f9d85 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8cfcd5c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e20e426 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0184c7f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3ef1ed6 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    591d322 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    94ef3a5 View commit details
    Browse the repository at this point in the history
  11. fix(typing): Resolve Liskov violations

    ```
    altair\vegalite\v5\api.py:4368: error: Argument 1 of "__iadd__" is incompatible with "__add__" of supertype "TopLevelMixin"; supertype defines the argument type as "Chart | RepeatChart | ConcatChart | HConcatChart | VConcatChart | FacetChart | LayerChart"  [override]         def __iadd__(self, other: LayerChart | Chart) -> Self:                            ^~~~~~~~~~~~~~~~~~~~~~~~~ altair\vegalite\v5\api.py:4368: note: This violates the Liskov substitution principle altair\vegalite\v5\api.py:4368: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides altair\vegalite\v5\api.py:4376: error: Argument 1 of "__add__" is incompatible with supertype "TopLevelMixin"; supertype defines the argument type as "Chart | RepeatChart | ConcatChart | HConcatChart | VConcatChart | FacetChart | LayerChart"  [override]         def __add__(self, other: LayerChart | Chart) -> Self:                           ^~~~~~~~~~~~~~~~~~~~~~~~~ altair\vegalite\v5\api.py:4376: note: This violates the Liskov substitution principle altair\vegalite\v5\api.py:4376: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
    ```
    dangotbanned committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    470a490 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8287f5e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    00985dc View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    831d653 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    60281f5 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    3d3fd1e View commit details
    Browse the repository at this point in the history
  17. chore(ruff): Add note on ANN

    This could later be extended to other modules, but for now `api` is complete.
    dangotbanned committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    010d4fb View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    26fd795 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    8e27862 View commit details
    Browse the repository at this point in the history
  2. fix(typing): Add missing FacetChart annotations

    To align with the other `ChartType`s
    dangotbanned committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    c5ab6f0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1803550 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Configuration menu
    Copy the full SHA
    18c014e View commit details
    Browse the repository at this point in the history