-
Notifications
You must be signed in to change notification settings - Fork 64
docs: remove import bigframes.pandas as bpd boilerplate from many samples #2147
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 6 commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
8cfaca6
docs: remove import bigframes.pandas as bpd boilerplate from many sam…
tswast c85d47f
fix docs
tswast 78bfccf
fix unit tests
tswast 210dc9a
skip sklearn test
tswast bed4069
fix snapshot
tswast aa23fca
Merge branch 'main' into tswast-doctest-boilerplate
tswast 20cae2d
plumb through session for from_tuples and from_arrays
tswast f57a8c3
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast d8ab16b
Merge remote-tracking branch 'origin/tswast-doctest-boilerplate' into…
tswast 1dc648b
add from_frame
tswast 9de6f9f
make sure polars session isnt skipped on Kokoro
tswast 5d23dee
fix apply doctest
tswast 20d7c27
make doctest conftest available everywhere
tswast 534471e
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast fbe606e
add python version flexibility for to_dict
tswast 171f3ec
disambiguate explicit names
tswast ded5c1e
disambiguate explicit name none versus no name
tswast 841bc64
fix for column name comparison in pandas bin op
tswast 81f49a6
avoid setting column labels in special case of Series(block)
tswast f7a017a
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast 5b60505
revert doctest changes
tswast a97cc93
revert doctest changes
tswast 5aaacfe
revert df docstrings
tswast 922bbf4
add polars series unit tests
tswast 765b678
restore a test
tswast 4aa47a8
Revert "restore a test"
tswast f75f5bf
skip null
tswast a7058ac
skip unsupported tests
tswast 62d5911
revert more docs changes
tswast 70021f3
revert more docs
tswast 9350209
revert more docs
tswast 23346b0
fix unit tests python 3.13
tswast 03822d7
add test to reproduce name error
tswast dc02baf
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast 5df828b
add tests for session scoped methods
tswast ddbb32d
revert new session methods
tswast d80bfcb
fix TestSession read_pandas for Series
tswast 0a5a935
revert more unnecessary changes
tswast 1126244
even more
tswast 8b069e8
Merge branch 'tswast-session-methods' into tswast-doctest-boilerplate
tswast d63a95f
add unit_noextras to improve code coverage
tswast 6a8f694
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast 6aadbaf
run system tests on latest fully supported
tswast beb3a7d
Merge branch 'tswast-polars-session-names' into tswast-doctest-boiler…
tswast 95e4394
system-3.12 not found
tswast d33147a
cap polars version
tswast 676c8b0
Merge branch 'main' into tswast-polars-session-names
tswast a7f542c
hide progress bar
tswast 699ce4d
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast ace646a
relax polars upper pin
tswast c799b28
Merge branch 'tswast-polars-session-names' into tswast-doctest-boiler…
tswast b2c078b
try to restore docs changes
tswast e6f711f
remove progress bar boilerplate
tswast 9906cc8
remove standardd community imports boilerplate
tswast 00b89d6
restore bpd to datetimelike
tswast 44a4cab
remove bpd boilerplate
tswast f884610
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast b81a6e6
avoid bpd.NA
tswast fe54feb
fix more docs
tswast 150d8be
dont skip tests if polars isnt installed
tswast 4334a44
fix more doctests
tswast 937fff7
skip remote functions in Series.apply
tswast 358fc0e
feat: implement cos, sin, and log operations for polars compiler
tswast c7438c2
Merge branch 'tswast-log' into tswast-doctest-boilerplate
tswast 42c8586
fix domain for log
tswast 22e6fb2
update snapshot
tswast 1157f41
fix domain for log
tswast f36cce2
update snapshot
tswast 7ed9029
revert sqrt change
tswast 2b97c2b
revert sqrt change
tswast 4462425
Merge branch 'main' into tswast-log
tswast dd28c1c
Merge branch 'tswast-log' into tswast-doctest-boilerplate
tswast 90cf6ab
Merge remote-tracking branch 'origin/tswast-log' into tswast-doctest-…
tswast 7dc6db7
fix more samples
tswast af90071
Merge branch 'main' into tswast-doctest-boilerplate
tswast 3bb0464
sync polars compiler with main
tswast e7425fc
avoid np in output
tswast e99de45
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast 2aa7f25
Update tests/unit/core/compile/sqlglot/expressions/snapshots/test_num…
tswast 9414971
Update bigframes/core/compile/sqlglot/expressions/numeric_ops.py
tswast 8ced818
upgrade requirements in polars sample
tswast 9db2c19
Merge remote-tracking branch 'origin/tswast-doctest-boilerplate' into…
tswast e4c5571
Merge branch 'main' into tswast-doctest-boilerplate
tswast 49f32b8
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast c3a9d61
add todo for making doctest more robust
tswast e1f3f2d
Merge remote-tracking branch 'origin/tswast-doctest-boilerplate' into…
tswast 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
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
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
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 |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import numpy as np | ||
| import pandas as pd | ||
| import pyarrow as pa | ||
| import pytest | ||
|
|
||
| import bigframes._config | ||
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def polars_session(): | ||
| pytest.importorskip("polars") | ||
|
|
||
| from bigframes.testing import polars_session | ||
|
|
||
| return polars_session.TestSession() | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def default_doctest_imports(doctest_namespace, polars_session): | ||
| """ | ||
| Avoid some boilerplate in pandas-inspired tests. | ||
|
|
||
| See: https://docs.pytest.org/en/stable/how-to/doctest.html#doctest-namespace-fixture | ||
| """ | ||
| doctest_namespace["np"] = np | ||
| doctest_namespace["pd"] = pd | ||
| doctest_namespace["pa"] = pa | ||
| doctest_namespace["bpd"] = polars_session | ||
| bigframes._config.options.display.progress_bar = None | ||
|
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. I recommend reviewing this with "hide whitespace" turned on. The only change is to increase indentation to fix samples tests that break due to an attempted import of this file without Polars installed. |
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.
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.
I wonder if instead, we should just inject the polars session as global session? Not sure all the methods are the same, but I guess it works so far?
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.
Unfortunately, there's quite a bit that isn't supported yet on the Polars session. Doing it this way means that we can override
bpdto be the BQ version in the samples itself with a simple import.