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

fix(typing): Improve Then annotations, autocompletion, docs #3567

Merged
merged 35 commits into from
Sep 22, 2024

Commits on Sep 4, 2024

  1. fix(DRAFT): Add examples for SchemaLike

    Purely demonstrating type checking behaviour for vega#3552 (comment)
    dangotbanned committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    331a52e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    633c0c2 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2024

  1. Configuration menu
    Copy the full SHA
    f59a290 View commit details
    Browse the repository at this point in the history
  2. style: Reorder _Condition... definitions

    Revisting these I found it confusing that they were defined like (A, B, B, A).
    They are now (A, A, B, B) so it is clearer how they are linked
    dangotbanned committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    f34abe9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2dc1f21 View commit details
    Browse the repository at this point in the history
  4. test: Extend test_when_typing

    Aiming to get all of these to pass, without breaking anything else.
    **CI fail expected**
    dangotbanned committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    c86a107 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2024

  1. Configuration menu
    Copy the full SHA
    5ab0616 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    adf3e56 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7315582 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d169a1b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c5632f4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2f74e8e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    160b16c View commit details
    Browse the repository at this point in the history
  8. fix: Make Parameter, (Parameter|Selection)Expression SchemaLike

    …-compliant
    
    Can't define this in `OperatorMixin`, as `Expression` uses `{"type": "string"}`
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    e470a98 View commit details
    Browse the repository at this point in the history
  9. test: Update test_when_typing

    Added a lot of notes here, since I was surpised `Then` would not be allowed in the cases I had planned originally
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    f49c9f5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a773c97 View commit details
    Browse the repository at this point in the history
  11. fix: Update TypedDict version bound

    We're using a feature that didn't make it into `3.13` yet https://peps.python.org/pep-0728/
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    9f49ef6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c420a1c View commit details
    Browse the repository at this point in the history
  13. fix: Confirm ChainedWhen.then structural soundness

    The warning raised by `pyright` here was actually quite helpful.
    Essentially, a shorthand string is never allowed here
    
    vega#3552 (comment)
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    7925d90 View commit details
    Browse the repository at this point in the history
  14. test: Update test_when_multiple_fields

    We now provide more precise errors identifying exactly which call produced the issue.
    Previously, the `.then("min(foo):Q")` was silently allowed - but later rejected in `.otherwise()`.
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    960e134 View commit details
    Browse the repository at this point in the history
  15. chore(typing): Add a temporary ignore

    I'm fairly sure this is fixed in another branch, so leaving this here for less of a conflict
    https://github.com/vega/altair/pull/3547/files#diff-bbe4e187b18d242a366c820d023afd89041759cb96e4ec66c3f34559a72c2f9d
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    5ee39c2 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    969e0e3 View commit details
    Browse the repository at this point in the history
  17. feat: Add repr for Then

    No longer inherited
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    8cad6af View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    2d9f248 View commit details
    Browse the repository at this point in the history
  19. docs: Add SchemaLike doc

    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    da9784e View commit details
    Browse the repository at this point in the history
  20. feat: Use module.__all__ to simplify generate_api_docs

    Removes the need for hardcoding restrictions in multiple places
    dangotbanned committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    1971daa View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    3e51d1e View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Configuration menu
    Copy the full SHA
    d20109e View commit details
    Browse the repository at this point in the history
  2. refactor(typing): Factor out _ConditionType, use _Condition (`Typ…

    …edDict`)
    
    - Adds some more consistency between `condition` and `when-then-otherwise`
    - 1 less thing to think about
    dangotbanned committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    0a6d599 View commit details
    Browse the repository at this point in the history
  3. test(typing): Wrap returned "immutable" TypedDict before modifying

    This isn't a runtime concern, just to satisfy typing
    dangotbanned committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    7865c91 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0a93309 View commit details
    Browse the repository at this point in the history
  5. feat(typing): Adds Any... aliases in channels.py

    Mostly pushing this as an experiment.
    Shortens signatures, but there is a cost to the indirection
    
    vega#3567 (comment)
    dangotbanned committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    08bf16e View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2024

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

Commits on Sep 21, 2024

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

Commits on Sep 22, 2024

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