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: Support Chart.transform_filter(*predicates, **constraints) #3664

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5bdb33d
chore(typing): Add temporary alias for `filter`
dangotbanned Oct 30, 2024
2efd5f8
refactor: Make `empty` a regular keyword arg
dangotbanned Oct 30, 2024
d2868f8
refactor: Remove `**kwargs`
dangotbanned Oct 30, 2024
841e887
docs: Add note on `Predicate`
dangotbanned Oct 30, 2024
63de259
feat(DRAFT): Adds `_transform_filter_impl`
dangotbanned Oct 30, 2024
40146f7
Merge remote-tracking branch 'upstream/main' into transform-filter-pr…
dangotbanned Oct 30, 2024
c22ba58
feat: Adds `transform_filter` implementation
dangotbanned Oct 30, 2024
fc672bc
fix(DRAFT): Add temp ignore for `line_chart_with_cumsum_faceted`
dangotbanned Oct 30, 2024
8554a46
feat(typing): Widen `_FieldEqualType` to include `IntoExpression`
dangotbanned Oct 30, 2024
ff9d33f
fix: Try replacing `Undefined` first
dangotbanned Oct 31, 2024
b497039
test: Add `(*predicates, **constraints)` syntax tests
dangotbanned Oct 31, 2024
54d0cbc
Merge branch 'main' into transform-filter-predicates
dangotbanned Nov 2, 2024
a375ab5
Merge remote-tracking branch 'upstream/main' into transform-filter-pr…
dangotbanned Nov 3, 2024
7f6c188
docs: Use `*predicates` in "Faceted Line Chart with Cumulative Sum"
dangotbanned Nov 3, 2024
0d4ff86
Merge remote-tracking branch 'upstream/main' into transform-filter-pr…
dangotbanned Nov 4, 2024
be63d4e
refactor: Remove `_OrigFilterType`
dangotbanned Nov 4, 2024
7a0cc42
docs: Update `.transform_filter()` docstring
dangotbanned Nov 4, 2024
08a4207
docs: Minor corrections in examples
dangotbanned Nov 4, 2024
5fd4f5a
refactor(typing): Cast deprecated `filter` in one location
dangotbanned Nov 4, 2024
d640933
refactor: Remove `pred` assignment
dangotbanned Nov 4, 2024
2d57d6e
docs(typing): Update `_FieldEqualType`
dangotbanned Nov 4, 2024
01571dd
Merge branch 'main' into transform-filter-predicates
dangotbanned Nov 4, 2024
10f1d1d
Merge branch 'main' into transform-filter-predicates
dangotbanned Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
columns_sorted = ['Drought', 'Epidemic', 'Earthquake', 'Flood']

alt.Chart(source).transform_filter(
{'and': [
{'and': [ # type: ignore[arg-type]
dangotbanned marked this conversation as resolved.
Show resolved Hide resolved
alt.FieldOneOfPredicate(field='Entity', oneOf=columns_sorted), # Filter data to show only disasters in columns_sorted
alt.FieldRangePredicate(field='Year', range=[1900, 2000]) # Filter data to show only 20th century
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
columns_sorted = ['Drought', 'Epidemic', 'Earthquake', 'Flood']

alt.Chart(source).transform_filter(
{'and': [
{'and': [ # type: ignore[arg-type]
alt.FieldOneOfPredicate(field='Entity', oneOf=columns_sorted), # Filter data to show only disasters in columns_sorted
alt.FieldRangePredicate(field='Year', range=[1900, 2000]) # Filter data to show only 20th century
]}
Expand Down