-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Add filters and columns arguments to read_gbq for enhanced data querying #198
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 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7a006b0
feat: Add filters argument to read_gbq for enhanced data querying
Genesis929 37794a3
feat: Add filters argument to read_gbq for enhanced data querying
Genesis929 499bdcd
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 300263e
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] fdc539d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 6ed4194
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] ad6d37f
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] 3473780
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] 276bfd0
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] 8a4e940
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] b29e9b7
Merge branch 'main' into b299514019-read-gbq-filter
Genesis929 c00a05e
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] dd94369
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] 54ca688
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] 95e318b
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] ced491f
feat: Add filters and columns arguments to read_gbq for enhanced data…
gcf-owl-bot[bot] 0f2840d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 771d093
Merge branch 'main' into b299514019-read-gbq-filter
Genesis929 82f74fd
update docstring
Genesis929 1c038b5
Merge branch 'main' into b299514019-read-gbq-filter
tswast 354fd8e
remove columns input
Genesis929 434c559
make filter_to_query run only when there are filters
Genesis929 c17b815
remove named input
Genesis929 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,20 +7,8 @@ | |
|
||
from bigframes import constants | ||
|
||
FiltersType = ( | ||
Iterable[ | ||
Union[ | ||
Tuple[str, Literal["in", "not in", "<", "<=", "==", "!=", ">=", ">"], Any], | ||
Iterable[ | ||
Tuple[ | ||
str, | ||
Literal["in", "not in", "<", "<=", "==", "!=", ">=", ">"], | ||
Any, | ||
] | ||
], | ||
] | ||
], | ||
) | ||
FilterType = Tuple[str, Literal["in", "not in", "<", "<=", "==", "!=", ">=", ">"], Any] | ||
FiltersType = Iterable[Union[FilterType, Iterable[FilterType]]] | ||
|
||
|
||
class GBQIOMixin: | ||
|
@@ -100,15 +88,15 @@ def read_gbq( | |
max_results (Optional[int], default None): | ||
If set, limit the maximum number of rows to fetch from the | ||
query results. | ||
columns(Iterable[str], default ()): If not empty, only these columns | ||
columns (Iterable[str], default ()): If not empty, only these columns | ||
will be read from table. | ||
filters (List[Tuple], default ()): To filter out data. Filter syntax: | ||
[[(column, op, val), …],…] where op is [==, >, >=, <, <=, !=, in, | ||
not in] The innermost tuples are transposed into a set of filters | ||
applied through an AND operation. The outer list combines these | ||
sets of filters through an OR operation. A single list of tuples | ||
can also be used, meaning that no OR operation between set of | ||
filters is to be conducted. | ||
filters (Iterable[Iterable[[Tuple]], default ()): To filter out data. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be great to add a code sample (in the EXAMPLES section) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sample added. |
||
Filter syntax: [[(column, op, val), …],…] where op is [==, >, >=, | ||
<, <=, !=, in, not in] The innermost tuples are transposed into a | ||
set of filters applied through an AND operation. The outer list | ||
combines these sets of filters through an OR operation. A single | ||
list of tuples can also be used, meaning that no OR operation | ||
between set of filters is to be conducted. | ||
|
||
Returns: | ||
bigframes.dataframe.DataFrame: A DataFrame representing results of the query or table. | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this would be
Iterable[Union[Tuple, Iterable[Tuple]]]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.