Skip to content
Merged
Show file tree
Hide file tree
Changes from 82 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 Oct 7, 2025
c85d47f
fix docs
tswast Oct 7, 2025
78bfccf
fix unit tests
tswast Oct 7, 2025
210dc9a
skip sklearn test
tswast Oct 7, 2025
bed4069
fix snapshot
tswast Oct 7, 2025
aa23fca
Merge branch 'main' into tswast-doctest-boilerplate
tswast Oct 7, 2025
20cae2d
plumb through session for from_tuples and from_arrays
tswast Oct 8, 2025
f57a8c3
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast Oct 8, 2025
d8ab16b
Merge remote-tracking branch 'origin/tswast-doctest-boilerplate' into…
tswast Oct 8, 2025
1dc648b
add from_frame
tswast Oct 8, 2025
9de6f9f
make sure polars session isnt skipped on Kokoro
tswast Oct 8, 2025
5d23dee
fix apply doctest
tswast Oct 8, 2025
20d7c27
make doctest conftest available everywhere
tswast Oct 8, 2025
534471e
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast Oct 8, 2025
fbe606e
add python version flexibility for to_dict
tswast Oct 8, 2025
171f3ec
disambiguate explicit names
tswast Oct 8, 2025
ded5c1e
disambiguate explicit name none versus no name
tswast Oct 8, 2025
841bc64
fix for column name comparison in pandas bin op
tswast Oct 8, 2025
81f49a6
avoid setting column labels in special case of Series(block)
tswast Oct 8, 2025
f7a017a
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast Oct 8, 2025
5b60505
revert doctest changes
tswast Oct 8, 2025
a97cc93
revert doctest changes
tswast Oct 8, 2025
5aaacfe
revert df docstrings
tswast Oct 8, 2025
922bbf4
add polars series unit tests
tswast Oct 8, 2025
765b678
restore a test
tswast Oct 8, 2025
4aa47a8
Revert "restore a test"
tswast Oct 8, 2025
f75f5bf
skip null
tswast Oct 8, 2025
a7058ac
skip unsupported tests
tswast Oct 8, 2025
62d5911
revert more docs changes
tswast Oct 8, 2025
70021f3
revert more docs
tswast Oct 8, 2025
9350209
revert more docs
tswast Oct 8, 2025
23346b0
fix unit tests python 3.13
tswast Oct 9, 2025
03822d7
add test to reproduce name error
tswast Oct 9, 2025
dc02baf
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast Oct 9, 2025
5df828b
add tests for session scoped methods
tswast Oct 9, 2025
ddbb32d
revert new session methods
tswast Oct 9, 2025
d80bfcb
fix TestSession read_pandas for Series
tswast Oct 9, 2025
0a5a935
revert more unnecessary changes
tswast Oct 9, 2025
1126244
even more
tswast Oct 9, 2025
8b069e8
Merge branch 'tswast-session-methods' into tswast-doctest-boilerplate
tswast Oct 9, 2025
d63a95f
add unit_noextras to improve code coverage
tswast Oct 9, 2025
6a8f694
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast Oct 9, 2025
6aadbaf
run system tests on latest fully supported
tswast Oct 9, 2025
beb3a7d
Merge branch 'tswast-polars-session-names' into tswast-doctest-boiler…
tswast Oct 9, 2025
95e4394
system-3.12 not found
tswast Oct 9, 2025
d33147a
cap polars version
tswast Oct 9, 2025
676c8b0
Merge branch 'main' into tswast-polars-session-names
tswast Oct 14, 2025
a7f542c
hide progress bar
tswast Oct 14, 2025
699ce4d
Merge remote-tracking branch 'origin/main' into tswast-polars-session…
tswast Oct 14, 2025
ace646a
relax polars upper pin
tswast Oct 14, 2025
c799b28
Merge branch 'tswast-polars-session-names' into tswast-doctest-boiler…
tswast Oct 14, 2025
b2c078b
try to restore docs changes
tswast Oct 14, 2025
e6f711f
remove progress bar boilerplate
tswast Oct 14, 2025
9906cc8
remove standardd community imports boilerplate
tswast Oct 14, 2025
00b89d6
restore bpd to datetimelike
tswast Oct 14, 2025
44a4cab
remove bpd boilerplate
tswast Oct 14, 2025
f884610
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast Oct 14, 2025
b81a6e6
avoid bpd.NA
tswast Oct 14, 2025
fe54feb
fix more docs
tswast Oct 14, 2025
150d8be
dont skip tests if polars isnt installed
tswast Oct 15, 2025
4334a44
fix more doctests
tswast Oct 15, 2025
937fff7
skip remote functions in Series.apply
tswast Oct 15, 2025
358fc0e
feat: implement cos, sin, and log operations for polars compiler
tswast Oct 15, 2025
c7438c2
Merge branch 'tswast-log' into tswast-doctest-boilerplate
tswast Oct 15, 2025
42c8586
fix domain for log
tswast Oct 15, 2025
22e6fb2
update snapshot
tswast Oct 15, 2025
1157f41
fix domain for log
tswast Oct 15, 2025
f36cce2
update snapshot
tswast Oct 15, 2025
7ed9029
revert sqrt change
tswast Oct 15, 2025
2b97c2b
revert sqrt change
tswast Oct 15, 2025
4462425
Merge branch 'main' into tswast-log
tswast Oct 15, 2025
dd28c1c
Merge branch 'tswast-log' into tswast-doctest-boilerplate
tswast Oct 15, 2025
90cf6ab
Merge remote-tracking branch 'origin/tswast-log' into tswast-doctest-…
tswast Oct 15, 2025
7dc6db7
fix more samples
tswast Oct 15, 2025
af90071
Merge branch 'main' into tswast-doctest-boilerplate
tswast Oct 15, 2025
3bb0464
sync polars compiler with main
tswast Oct 15, 2025
e7425fc
avoid np in output
tswast Oct 15, 2025
e99de45
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast Oct 15, 2025
2aa7f25
Update tests/unit/core/compile/sqlglot/expressions/snapshots/test_num…
tswast Oct 15, 2025
9414971
Update bigframes/core/compile/sqlglot/expressions/numeric_ops.py
tswast Oct 15, 2025
8ced818
upgrade requirements in polars sample
tswast Oct 16, 2025
9db2c19
Merge remote-tracking branch 'origin/tswast-doctest-boilerplate' into…
tswast Oct 16, 2025
e4c5571
Merge branch 'main' into tswast-doctest-boilerplate
tswast Oct 16, 2025
49f32b8
Merge remote-tracking branch 'origin/main' into tswast-doctest-boiler…
tswast Oct 16, 2025
c3a9d61
add todo for making doctest more robust
tswast Oct 16, 2025
e1f3f2d
Merge remote-tracking branch 'origin/tswast-doctest-boilerplate' into…
tswast Oct 16, 2025
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@

* Address `read_csv` with both `index_col` and `use_cols` behavior inconsistency with pandas ([#1785](https://github.com/googleapis/python-bigquery-dataframes/issues/1785)) ([ba7c313](https://github.com/googleapis/python-bigquery-dataframes/commit/ba7c313c8d308e3ff3f736b60978cb7a51715209))
* Allow KMeans model init parameter as k-means++ alias ([#1790](https://github.com/googleapis/python-bigquery-dataframes/issues/1790)) ([0b59cf1](https://github.com/googleapis/python-bigquery-dataframes/commit/0b59cf1008613770fa1433c6da395e755c86fe22))
* Replace function now can handle bpd.NA value. ([#1786](https://github.com/googleapis/python-bigquery-dataframes/issues/1786)) ([7269512](https://github.com/googleapis/python-bigquery-dataframes/commit/7269512a28eb42029447d5380c764353278a74e1))
* Replace function now can handle pd.NA value. ([#1786](https://github.com/googleapis/python-bigquery-dataframes/issues/1786)) ([7269512](https://github.com/googleapis/python-bigquery-dataframes/commit/7269512a28eb42029447d5380c764353278a74e1))


### Documentation
Expand Down
7 changes: 0 additions & 7 deletions bigframes/bigquery/_operations/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def generate(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> country = bpd.Series(["Japan", "Canada"])
>>> bbq.ai.generate(("What's the capital city of ", country, " one word only"))
0 {'result': 'Tokyo\\n', 'full_response': '{"cand...
Expand Down Expand Up @@ -155,7 +154,6 @@ def generate_bool(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> df = bpd.DataFrame({
... "col_1": ["apple", "bear", "pear"],
... "col_2": ["fruit", "animal", "animal"]
Expand Down Expand Up @@ -240,7 +238,6 @@ def generate_int(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> animal = bpd.Series(["Kangaroo", "Rabbit", "Spider"])
>>> bbq.ai.generate_int(("How many legs does a ", animal, " have?"))
0 {'result': 2, 'full_response': '{"candidates":...
Expand Down Expand Up @@ -322,7 +319,6 @@ def generate_double(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> animal = bpd.Series(["Kangaroo", "Rabbit", "Spider"])
>>> bbq.ai.generate_double(("How many legs does a ", animal, " have?"))
0 {'result': 2.0, 'full_response': '{"candidates...
Expand Down Expand Up @@ -402,7 +398,6 @@ def if_(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> us_state = bpd.Series(["Massachusetts", "Illinois", "Hawaii"])
>>> bbq.ai.if_((us_state, " has a city called Springfield"))
0 True
Expand Down Expand Up @@ -459,7 +454,6 @@ def classify(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> df = bpd.DataFrame({'creature': ['Cat', 'Salmon']})
>>> df['type'] = bbq.ai.classify(df['creature'], ['Mammal', 'Fish'])
>>> df
Expand Down Expand Up @@ -517,7 +511,6 @@ def score(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> animal = bpd.Series(["Tiger", "Rabbit", "Blue Whale"])
>>> bbq.ai.score(("Rank the relative weights of ", animal, " on the scale from 1 to 3")) # doctest: +SKIP
0 2.0
Expand Down
1 change: 0 additions & 1 deletion bigframes/bigquery/_operations/approx_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def approx_top_count(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None
>>> s = bpd.Series(["apple", "apple", "pear", "pear", "pear", "banana"])
>>> bbq.approx_top_count(s, number=2)
[{'value': 'pear', 'count': 3}, {'value': 'apple', 'count': 2}]
Expand Down
5 changes: 0 additions & 5 deletions bigframes/bigquery/_operations/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def array_length(series: series.Series) -> series.Series:

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([[1, 2, 8, 3], [], [3, 4]])
>>> bbq.array_length(s)
Expand Down Expand Up @@ -78,8 +77,6 @@ def array_agg(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> import numpy as np
>>> bpd.options.display.progress_bar = None

For a SeriesGroupBy object:

Expand Down Expand Up @@ -128,8 +125,6 @@ def array_to_string(series: series.Series, delimiter: str) -> series.Series:

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> import numpy as np
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([["H", "i", "!"], ["Hello", "World"], np.nan, [], ["Hi"]])
>>> bbq.array_to_string(s, delimiter=", ")
Expand Down
6 changes: 0 additions & 6 deletions bigframes/bigquery/_operations/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ def unix_seconds(input: series.Series) -> series.Series:

**Examples:**

>>> import pandas as pd
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([pd.Timestamp("1970-01-02", tz="UTC"), pd.Timestamp("1970-01-03", tz="UTC")])
>>> bbq.unix_seconds(s)
Expand All @@ -48,10 +46,8 @@ def unix_millis(input: series.Series) -> series.Series:

**Examples:**

>>> import pandas as pd
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([pd.Timestamp("1970-01-02", tz="UTC"), pd.Timestamp("1970-01-03", tz="UTC")])
>>> bbq.unix_millis(s)
Expand All @@ -75,10 +71,8 @@ def unix_micros(input: series.Series) -> series.Series:

**Examples:**

>>> import pandas as pd
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([pd.Timestamp("1970-01-02", tz="UTC"), pd.Timestamp("1970-01-03", tz="UTC")])
>>> bbq.unix_micros(s)
Expand Down
9 changes: 0 additions & 9 deletions bigframes/bigquery/_operations/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def st_area(
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> from shapely.geometry import Polygon, LineString, Point
>>> bpd.options.display.progress_bar = None

>>> series = bigframes.geopandas.GeoSeries(
... [
Expand Down Expand Up @@ -125,7 +124,6 @@ def st_buffer(
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> from shapely.geometry import Point
>>> bpd.options.display.progress_bar = None

>>> series = bigframes.geopandas.GeoSeries(
... [
Expand Down Expand Up @@ -195,7 +193,6 @@ def st_centroid(
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> from shapely.geometry import Polygon, LineString, Point
>>> bpd.options.display.progress_bar = None

>>> series = bigframes.geopandas.GeoSeries(
... [
Expand Down Expand Up @@ -250,7 +247,6 @@ def st_convexhull(
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> from shapely.geometry import Polygon, LineString, Point
>>> bpd.options.display.progress_bar = None

>>> series = bigframes.geopandas.GeoSeries(
... [
Expand Down Expand Up @@ -312,7 +308,6 @@ def st_difference(
>>> import bigframes.bigquery as bbq
>>> import bigframes.geopandas
>>> from shapely.geometry import Polygon, LineString, Point
>>> bpd.options.display.progress_bar = None

We can check two GeoSeries against each other, row by row:

Expand Down Expand Up @@ -407,7 +402,6 @@ def st_distance(
>>> import bigframes.bigquery as bbq
>>> import bigframes.geopandas
>>> from shapely.geometry import Polygon, LineString, Point
>>> bpd.options.display.progress_bar = None

We can check two GeoSeries against each other, row by row.

Expand Down Expand Up @@ -489,7 +483,6 @@ def st_intersection(
>>> import bigframes.bigquery as bbq
>>> import bigframes.geopandas
>>> from shapely.geometry import Polygon, LineString, Point
>>> bpd.options.display.progress_bar = None

We can check two GeoSeries against each other, row by row.

Expand Down Expand Up @@ -583,7 +576,6 @@ def st_isclosed(
>>> import bigframes.bigquery as bbq

>>> from shapely.geometry import Point, LineString, Polygon
>>> bpd.options.display.progress_bar = None

>>> series = bigframes.geopandas.GeoSeries(
... [
Expand Down Expand Up @@ -650,7 +642,6 @@ def st_length(
>>> import bigframes.bigquery as bbq

>>> from shapely.geometry import Polygon, LineString, Point, GeometryCollection
>>> bpd.options.display.progress_bar = None

>>> series = bigframes.geopandas.GeoSeries(
... [
Expand Down
12 changes: 0 additions & 12 deletions bigframes/bigquery/_operations/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ def json_set(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> import numpy as np
>>> bpd.options.display.progress_bar = None

>>> s = bpd.read_gbq("SELECT JSON '{\\\"a\\\": 1}' AS data")["data"]
>>> bbq.json_set(s, json_path_value_pairs=[("$.a", 100), ("$.b", "hi")])
Expand Down Expand Up @@ -101,7 +99,6 @@ def json_extract(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['{"class": {"students": [{"id": 5}, {"id": 12}]}}'])
>>> bbq.json_extract(s, json_path="$.class")
Expand Down Expand Up @@ -141,7 +138,6 @@ def json_extract_array(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['[1, 2, 3]', '[4, 5]'])
>>> bbq.json_extract_array(s)
Expand Down Expand Up @@ -204,7 +200,6 @@ def json_extract_string_array(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['[1, 2, 3]', '[4, 5]'])
>>> bbq.json_extract_string_array(s)
Expand Down Expand Up @@ -272,7 +267,6 @@ def json_query(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['{"class": {"students": [{"id": 5}, {"id": 12}]}}'])
>>> bbq.json_query(s, json_path="$.class")
Expand Down Expand Up @@ -303,7 +297,6 @@ def json_query_array(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['[1, 2, 3]', '[4, 5]'])
>>> bbq.json_query_array(s)
Expand Down Expand Up @@ -355,7 +348,6 @@ def json_value(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['{"name": "Jakob", "age": "6"}', '{"name": "Jakob", "age": []}'])
>>> bbq.json_value(s, json_path="$.age")
Expand Down Expand Up @@ -392,7 +384,6 @@ def json_value_array(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['[1, 2, 3]', '[4, 5]'])
>>> bbq.json_value_array(s)
Expand Down Expand Up @@ -439,7 +430,6 @@ def to_json(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([1, 2, 3])
>>> bbq.to_json(s)
Expand Down Expand Up @@ -473,7 +463,6 @@ def to_json_string(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([1, 2, 3])
>>> bbq.to_json_string(s)
Expand Down Expand Up @@ -512,7 +501,6 @@ def parse_json(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(['{"class": {"students": [{"id": 5}, {"id": 12}]}}'])
>>> s
Expand Down
1 change: 0 additions & 1 deletion bigframes/bigquery/_operations/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def vector_search(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> bpd.options.display.progress_bar = None

DataFrame embeddings for which to find nearest neighbors. The ``ARRAY<FLOAT64>`` column
is used as the search query:
Expand Down
3 changes: 0 additions & 3 deletions bigframes/bigquery/_operations/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ def sql_scalar(

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> import pandas as pd
>>> import pyarrow as pa
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series(["1.5", "2.5", "3.5"])
>>> s = s.astype(pd.ArrowDtype(pa.decimal128(38, 9)))
Expand Down
1 change: 0 additions & 1 deletion bigframes/bigquery/_operations/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def struct(value: dataframe.DataFrame) -> series.Series:
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> import bigframes.series as series
>>> bpd.options.display.progress_bar = None

>>> srs = series.Series([{"version": 1, "project": "pandas"}, {"version": 2, "project": "numpy"},])
>>> df = srs.struct.explode()
Expand Down
Loading