-
-
Notifications
You must be signed in to change notification settings - Fork 810
feat: Improve the syntax for conditions with multiple predicates #3427
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
Merged
Merged
Changes from all commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
303f784
fix: add overloads for `condition`
dangotbanned 866a50e
build: regen `__all__` excluding `@overload`
dangotbanned 7ddd214
fix: add statement overloads for `condition`
dangotbanned 2b3c2f8
refactor: add `typing.Tuple` to `api` and `update_init_file`
dangotbanned 61ab923
feat(typing): amend and extend aliases for conditions
dangotbanned a33efa3
feat(typing): update `condition` signature, overloads to use new aliases
dangotbanned 79af12d
refactor: extract condition utility functions
dangotbanned d901679
refactor: extract condition parsing functions
dangotbanned 03a372c
refactor: add `ruff` ignores to keep `expr` in `api`
dangotbanned 8d455d1
refactor: replaced contents of `condition` with extracted functions
dangotbanned 8df67e1
style: rerun `ruff`
dangotbanned aa35acf
test: Skip tests on Win that require a tz database
dangotbanned 747ca6b
fix(typing): Correct `SchemaBase.to_dict` return type
dangotbanned 14f6ea1
perf: Build base `units` for `utils.parse_shorthand` once
dangotbanned f20949d
feat: align both sides of `if_true`/ `if_false` parsing
dangotbanned 9d202e5
test: Update single test that relied on intermediate shorthand
dangotbanned 278f4f4
feat(typing): add `_is_statement_type` guard
dangotbanned 113a793
docs: add reference to `predicate`
dangotbanned d6fea15
feat(typing): adds `_Conditions` intermediate representation
dangotbanned 9c89bce
feat: Adds initial `when-then-otherwise` implementation
dangotbanned a09c13c
test: Add tests for `when-then-otherwise`
dangotbanned e7be069
fix(typing): Use `typing.List`
dangotbanned 1ad06f4
fix(typing): fix(typing): Correct SchemaBase.to_dict return type
dangotbanned 61279cd
fix(typing): Use safer `typing_extensions.runtime_checkable` unless `…
dangotbanned cf92402
perf: Don't recheck type after positive case in `infer_encoding_types`
dangotbanned 22e89a8
feat: adds `_Then.to_dict`
dangotbanned dfc14de
feat: allow `_Then` as an encoding input
dangotbanned 328338a
test: Add test for `_Then` as encoding condition
dangotbanned 430898f
fix(typing): Remove `UndefinedType` from `_ConditionType`
dangotbanned 5f49715
refactor: Simplify `_predicate_to_condition`
dangotbanned 460444c
refactor: removed outdated comments
dangotbanned c8469ed
fix(typing): Correct `alt.value` return annotation
dangotbanned 4b8353b
refactor: moved comment
dangotbanned f1d9dc2
feat(typing): extends aliases and guards
dangotbanned 38d425f
feat: extend and refactor `when-then-otherwise` functionality
dangotbanned 80c32d3
fix(typing): exclude `typing_extensions.Protocol` and short `TypeVar`…
dangotbanned 7b5f711
test: update and extend tests for `when-then-otherwise`
dangotbanned b962c48
fix: add item to `pyproject.toml` to silence import errors for `pylan…
dangotbanned 3a1c640
test: check output type on all `when-then-otherwise` type errors
dangotbanned 7b671db
test: update tests, examples using deprecated `pandas` parameters
dangotbanned 5f631de
feat: Support additional predicate types in `when`, `condition`
dangotbanned fbd9205
feat: adds conversion functions between `alt.condition`/`when-then-ot…
dangotbanned 9af55c2
feat: Adds config to `alt.value` wrapping in `when-then-otherwise`
dangotbanned 80fbcbd
test: replace now-removed `wrap_value` parameter
dangotbanned 5da5622
test: additional `when-then-otherwise` tests
dangotbanned c994bf8
fix(typing): satisfy mypy
dangotbanned 8c0f45a
revert: 7b671db85d344fd6e0ca2d2a25a862d84118988c
dangotbanned 989b1f5
feat(typing): adds `_FieldEqualType` for when constraints
dangotbanned 7d41219
docs, feat: Add draft doc for `alt.when` and make public
dangotbanned 80a0812
docs: Replace markdown syntax with rst directives
dangotbanned bfa6d51
Merge branch 'vega:main' into condition-multiple
dangotbanned 237c874
sync
dangotbanned f4b51b8
Merge branch 'condition-multiple' of https://github.com/dangotbanned/…
dangotbanned 0a070c9
refactor: Remove unused `expr` import in `api`
dangotbanned b85223f
feat(typing): Preserve wrapper type in `alt.condition`
dangotbanned 30c1ad1
fix(typing): remove now-unused ignores
dangotbanned 95093d7
fix: Simplify complex `expr` import behaviour
dangotbanned 55cc301
fix: silence `unused-ignore` for `test_api` until `Chart.encode` fix …
dangotbanned 62ad8d1
docs: refine `alt.when` doc
dangotbanned 9cf84f9
docs: Improve `_When` docs
dangotbanned 58e0054
feat: make `alt.When` public
dangotbanned fe8ab25
test: Update test references to use public `alt.When`
dangotbanned e159ea0
docs: Fix some user guide sphinx errors
dangotbanned 8e92953
Merge remote-tracking branch 'origin/main' into condition-multiple
dangotbanned 910f493
revert(typing): re-enable mypy unused-ignore
dangotbanned 2276d50
test: better utilise `pytest.raises(match=...)`
dangotbanned 591a55b
refactor: UX-first improvements to imports, annotations
dangotbanned 0be41e8
docs: Add doc for `_Then.otherwise`
dangotbanned 11841d0
docs: Add doc for `_Then.when`
dangotbanned b48a812
feat: make `Then`, `ChainedWhen` public
dangotbanned 8c1e36b
docs: Add doc for `ChainedWhen.then`, misc fixes
dangotbanned 5baaa34
docs: add `api-cls` tree
dangotbanned 801cccc
refactor: remove `seq_as_lit` option
dangotbanned 25ac2fa
Merge branch 'main' into condition-multiple
dangotbanned b238aef
Merge branch 'main' into condition-multiple
dangotbanned 5f7d949
chore: remove type ignore comments
dangotbanned f89990f
revert: remove condition -> expr conversion experiment
dangotbanned c217b4f
fix: `mypy` error
dangotbanned 8f66b7a
Merge branch 'main' into condition-multiple
dangotbanned d12a741
feat: un-special case `Then`
dangotbanned 87b6014
fix: exclude `_typing` imports from `__all__`
dangotbanned 6f06b80
refactor(typing): replace `dict` w/ `Map` when possible
dangotbanned 1292962
feat: redesign `when-then-otherwise` to account for condition restric…
dangotbanned b110f65
test: update test to use `Then`'s getattr
dangotbanned f33a9cd
test: adds `test_when_stress`, `test_when_condition_parity`
dangotbanned f95be1a
ci: fix `PT001` rule inversion conflict
dangotbanned 31bad3f
feat(DRAFT): add experimental `_str_as`
dangotbanned d0784f8
refactor: `str_as_lit` -> `str_as`, invert default
dangotbanned fbd9088
Merge branch 'main' into condition-multiple
dangotbanned c8f7d6c
refactor: update `str_as` error
dangotbanned 8f5d352
refactor: rename `kwargs` -> `kwds`
dangotbanned 49c4d24
refactor(typing): use `_FieldEqualType` more consistently
dangotbanned 38d8a8e
refactor(typing): consistently annotate `TypeAlias`s
dangotbanned bd26c07
refactor(typing): remove lesser used aliases
dangotbanned 6245a8b
refactor(typing): replace lingering `UndefinedType`
dangotbanned 5e64fcb
refactor: inline `_str_as`, add note for `PEP728`
dangotbanned a3531fb
test: remove `alt.value` from example-based tests
dangotbanned 03d7ca5
Merge branch 'main' into condition-multiple
dangotbanned f8d7529
Merge branch 'main' into condition-multiple
dangotbanned c0afbad
Merge branch 'main' into condition-multiple
dangotbanned 86880c9
merge remote
dangotbanned e712b61
Merge branch 'condition-multiple' of https://github.com/dangotbanned/…
dangotbanned d607c70
Merge branch 'main' into condition-multiple
dangotbanned f992324
Merge branch 'main' into condition-multiple
dangotbanned 0f862ad
Merge branch 'main' into condition-multiple
dangotbanned 290da86
refactor: remove `str_as` and `alt.value(statement)` wrapping
dangotbanned 3fa4a3f
refactor(typing): remove/reorganize aliases and guards
dangotbanned 528ca16
docs: minor consistency update to `_ComposablePredicateType`
dangotbanned 159bcf1
chore: exclude `TypeAliasType` from `__all__`
dangotbanned 500f7e1
test: update existing `when` tests
dangotbanned db473c3
test: adds tests @mattijn authored during review
dangotbanned de08676
docs: fix lowercase
dangotbanned 633736d
docs: remove `str_as` references
dangotbanned 0f54057
revert: remove unrelated `expr` changes
dangotbanned 0ed9eab
docs(typing): add example to `_OneOrSeq`
dangotbanned fc6ce16
revert: Remove unrelated `pyproject.toml` changes
dangotbanned 4bc4732
chore: remove TODO comment
dangotbanned f0bc7b8
refactor: Define `SHORTHAND_KEYS` in `utils.core`
dangotbanned 33e17fa
docs: Update `_TestPredicateType` link
dangotbanned 59af293
refactor: remove single use `_is_composable_type` guard
dangotbanned c70d535
fix: More useful error message for `alt.[condition|when](predicate)`
dangotbanned 87cd9bd
docs: another consistency update
dangotbanned File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.