-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore(migration): Migrate code from googleapis/python-bigquery-dataframes into packages/bigframes #16493
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
Closed
chalmerlowe
wants to merge
2,227
commits into
main
from
migration.python-bigquery-dataframes.migration.2026-03-31_18-48-47.migrate
Closed
chore(migration): Migrate code from googleapis/python-bigquery-dataframes into packages/bigframes #16493
Changes from all commits
Commits
Show all changes
2227 commits
Select commit
Hold shift + click to select a range
4bc3b0a
docs: update docs and tests for Gemini 2.5 models (#2279)
GarrettWu f29de93
fix: Pass credentials properly for read api instantiation (#2280)
TrevorBergeron c4bba06
refactor: Remove never_skip_nulls param from window node def (#2273)
TrevorBergeron 7b2a2fe
deps: fix missing CTEs in sqlglot v28 and relax version dependency (#…
chelsea-lin 1b9a025
refactor: add agg_ops.CutOp to the sqlglot compiler (#2268)
chelsea-lin 525d4ff
chore: Migrate GeoStDistanceOp operator to SQLGlot (#2282)
jialuoo 02009a0
docs: use autosummary to split documentation pages (#2251)
tswast 2e2b0cf
refactor: WindowOpNode can create multiple cols (#2284)
TrevorBergeron 38d7052
Fix: Anywidget Table Pagination for Small DataFrames & Improve Displa…
shuoweil 7276a95
refactor: add agg_ops.QcutOp to the sqlglot compiler (#2269)
chelsea-lin 5bbd7c8
feat: add bigquery.json_keys (#2286)
chelsea-lin 25fd63b
refactor: switch RowNumber to 0-based indexing in sqlglot compiler (#…
chelsea-lin d25fd9c
Chore: Migrate unsafe_pow_op operator to SQLGlot (#2281)
jialuoo bb5a8fd
refactor: add agg_ops.ProductOp and NuniqueOp to the sqlglot compiler…
chelsea-lin dd8d171
docs: update API reference to new `dataframes.bigquery.dev` location …
tswast bf4fc84
docs: fix LogisticRegression docs rendering (#2295)
GarrettWu 2ab20ed
feat: Implement single-column sorting for interactive table widget (#…
shuoweil 3654fcf
chore: Migrate pow_op operator to SQLGlot (#2291)
jialuoo adf2dd1
feat: Add agg/aggregate methods to windows (#2288)
TrevorBergeron e4ae9c4
fix: Fix issue with stream upload batch size upload limit (#2290)
TrevorBergeron 6c612e9
refactor: fix ops.StrftimeOp, ops.ToDatetimeOp, ops.ToTimestampOp in …
chelsea-lin ab62fc1
refactor: fix agg_ops.DiffOp for Datetime and Timestamp (#2296)
chelsea-lin 875e9f7
refactor: fix some string ops in the sqlglot compiler. (#2299)
chelsea-lin 3bf5605
fix: Update max_instances default to reflect actual value (#2302)
jialuoo 4cbaa88
chore: fix librarian release current version (#2305)
GarrettWu e814882
docs: Add Google Analytics configuration to conf.py (#2301)
tswast 503e031
refactor: Migrate DataFrame display to use IPython's _repr_mimebundle…
shuoweil 4e77332
feat: Allow drop_duplicates over unordered dataframe (#2303)
TrevorBergeron 1b82e68
fix: Fix reset_index level=0 bugs (#2307)
TrevorBergeron be79099
chore: release 2.30.0 (#2308)
GarrettWu c0d412b
feat: add 'weekday' property to DatatimeMethod (#2304)
sycai 25b2aca
feat: add `bigframes.bigquery.ml` methods (#2300)
google-labs-jules[bot] fd08e98
Fix: Defer TableWidget import to prevent ZMQ port conflicts (#2309)
shuoweil df646ba
chore: Migrate DatetimeToIntegerLabelOp operator to SQLGlot (#2306)
jialuoo caefdc5
chore: fix pytest crash on pandas 3.0 due to missing SettingWithCopyW…
google-labs-jules[bot] 9715780
chore: fix unit tests on pandas 3.0 (#2317)
tswast 24c2b76
fix: cache DataFrames to temp tables in bigframes.bigquery.ml methods…
tswast e58cd20
revert: DataFrame display uses IPython's `_repr_mimebundle_` (#2316)
shuoweil 45462a4
chore: Move long-running LLM tests to the large directory (#2323)
google-labs-jules[bot] 5e1741d
chore: librarian release pull request: 20251210T234907Z (#2324)
TrevorBergeron 9a3301e
feat: add fit_predict method to ml unsupervised models (#2320)
GarrettWu e4f5645
fix: Fix pd.timedelta handling in polars comipler with polars 1.36 (#…
TrevorBergeron 4be4535
fix: Correct DataFrame widget rendering in Colab (#2319)
shuoweil af851d2
fix: Improve strictness of nan vs None usage (#2326)
TrevorBergeron 277fe33
test: Fix penguins_linear_model_w_global_explain fixture (#2327)
TrevorBergeron aed3e14
feat: Display custom single index column in anywidget mode (#2311)
shuoweil e5625ff
test: Make tests work with pandas 3.0 (#2329)
TrevorBergeron 1354937
chore: Add conventional-pre-commit hook (#2322)
tswast 352cc16
docs: Add time series analysis notebook (#2328)
shuoweil f1b9cb4
feat: Auto-plan complex reduction expressions (#2298)
TrevorBergeron 780b645
refactor: fix some string ops in the sqlglot compiler (part 2) (#2332)
chelsea-lin 0f065c6
refactor: fix some string ops in the sqlglot compiler (part 3) (#2336)
chelsea-lin e7453fb
Revert "fix: Update max_instances default to reflect actual value (#2…
TrevorBergeron 5338296
docs: update supported pandas APIs documentation links (#2330)
google-labs-jules[bot] 84f2893
chore: make `test_read_gbq_colab_includes_label` more robust to pytho…
tswast 06a1bd0
refactor: Handle special float values and None consistently in sqlglo…
chelsea-lin dc7f7f8
perf: Improve write api throughput using multiple streams (#2345)
TrevorBergeron 84f175d
refactor: fix SQLGlot doctests on the window, ai, to_json ops (#2341)
chelsea-lin 719f76d
perf: Fragmentize multiple col expressions as one (#2333)
TrevorBergeron 6d35c8e
tests: fix `test_get_formatted_time` from the `humanize` package upgr…
chelsea-lin 8a788bc
refactor: Anywidget Table Styling and Hover Enhancements (#2353)
shuoweil 6c74f9a
refactor: fix group_by compiler with dtype convertions (#2350)
chelsea-lin 238277e
refactor: support sql_predicate when compile readtable in sqlglot (#2…
chelsea-lin 31cbd26
docs: generate sitemap.xml for better search indexing (#2351)
tswast 15ca917
feat: Refactor TableWidget and to_pandas_batches (#2250)
shuoweil a6712c1
fix: bigframes.ml fit with eval data in partial mode avoids join on n…
google-labs-jules[bot] 1c9f521
feat: display series in anywidget mode (#2346)
shuoweil 4de2609
chore: make api method logging session-scoped (#2347)
google-labs-jules[bot] 5a68f5d
refactor: move inline styles to table_widget.css and use cla… (#2357)
shuoweil 3a36dc5
refactor: use CSS classes in HTML tables (#2358)
shuoweil 965a79b
fix(deps): vendor sqlglot bigquery dialect and remove package depende…
chelsea-lin 6312565
feat: Enable multi-column sorting in anywidget mode (#2360)
shuoweil fe05a0a
refactor: fix str.extract, blob ops and geo ops compiler (#2362)
chelsea-lin b2f83ed
chore: create a release (#2363)
tswast c49595e
feat: Configure Biome for Consistent Code Style (#2364)
shuoweil d154071
refactor: fix and, or and xor ops on NULL scalar (#2361)
chelsea-lin 759d1f8
chore: remove error message for sqlglot version (#2367)
chelsea-lin 3ffe30c
refactor: fix isin, explode and geo ops for sqlglot compiler (#2366)
chelsea-lin 1abdab0
fix: implement retry logic for cloud function endpoint fetching (#2369)
jialuoo 1a45b03
feat: Add dark mode to anywidget mode (#2365)
shuoweil 5642ec1
chore: remove language from sitemap paths (#2373)
tswast 189c22e
refactor: fix window and numeric/comparison ops for sqlglot compiler …
chelsea-lin 99ccbc6
chore: Migrate BinaryRemoteFunctionOp operator to SQLGlot (#2371)
jialuoo 62a22cc
feat: Add max_columns control for anywidget mode (#2374)
shuoweil 17055a7
test: remove deprecated claude-3-opus tests (#2375)
GarrettWu edd966b
refactor: move log_adapter.py under logging/ directory (#2376)
sycai a15557c
feat: Stabilize interactive table height to prevent notebook layout s…
shuoweil 989b496
refactor: adds null literal checks when sqlglot compiling eq and nq o…
chelsea-lin b00226b
refactor: fix some aggregation ops in the sqlglot compiler (#2382)
chelsea-lin 670b04e
chore: Migrate IntegerLabelToDatetimeOp operator to SQLGlot (#2310)
jialuoo 79ea7e1
chore: Migrate RemoteFunctionOp operator to SQLGlot (#2377)
jialuoo 5209349
feat: Add BigQuery ObjectRef functions to `bigframes.bigquery.obj` (#…
tswast ea1a001
fix: Throw if write api commit op has stream_errors (#2385)
TrevorBergeron db33833
chore: define type logging bit masks (#2384)
sycai 7eb5bbb
perf: Avoid requery for some result downsample methods (#2219)
TrevorBergeron 1ebbf12
refactor: fix math numeric_ops for test_series_ufuncs (#2386)
chelsea-lin 561b498
chore: Migrate NaryRemoteFunctionOp operator to SQLGlot (#2387)
jialuoo d1779b0
chore: deflake the ai generate doc test by skipping it (#2393)
sycai 2f419e8
chore: Add a function to traverse BFET and encode type usage (#2390)
sycai b33a265
feat: add bigquery.ml.transform function (#2394)
GarrettWu ed5b118
chore: librarian update image pull request: 20260122T223041Z (#2398)
chelsea-lin bf54d16
chore: librarian release pull request: 20260122T231714Z (#2402)
chelsea-lin 039c936
feat: add bigquery.ml.generate_text function (#2403)
GarrettWu 1fe63c4
refactor: fix several small presubmit test failures on the SQLGlot co…
chelsea-lin 663ab52
feat: add deprecation warnings for .blob accessor and read_gbq_object…
shuoweil 28f97f2
refactor: fix test_concat_dataframe by de-deuplicating merged ctes in…
chelsea-lin 4e96e44
fix: broken job url (#2411)
jbandoro f10eed1
feat: add bigquery.create_external_table method (#2415)
GarrettWu dc89b23
chore: Ignore ai ops in doctests (#2420)
TrevorBergeron c4eed0a
deps: Remove direct ipywidgets requirement (#2416)
TrevorBergeron 204d865
feat: add bigquery.ml.generate_embedding function (#2422)
GarrettWu 1f1412d
chore: Clean up nox test dependency installs (#2421)
TrevorBergeron 879f235
chore: move bigquery/table.py to bigquery/_operations/table.py (#2423)
GarrettWu d127a8b
feat: add `bigframes.pandas.options.experiments.sql_compiler` for swi…
chelsea-lin d0bebee
chore: remove redundant assertions (#2427)
GarrettWu 58a69db
chore: attach type usage to job labels (#2407)
sycai 6a1ddd1
feat: Suppress redundant "Completed" status in progress callback (#2419)
shuoweil a9a935f
chore: librarian release pull request:20260202T232430Z (#2428)
shuoweil f6b0cb5
feat: add bigframe.bigquery.load_data function (#2426)
GarrettWu a557099
feat: add `bigframes.bigquery.ai.generate_embedding` (#2343)
google-labs-jules[bot] 4475fd7
test: skip blob test (#2431)
shuoweil aa29a00
test: add system tests for bigquery.ml.create_model (#2432)
GarrettWu a62a7d1
feat: Add a bigframes cell magic for ipython (#2395)
TrevorBergeron 964abf6
feat: add bigquery.ai.generate_text function (#2433)
sycai 5d0ffb8
deps: Drop support for python 3.9 (#2418)
TrevorBergeron 3f0a223
docs: fix cast method shown on public docs (#2436)
GarrettWu a8f049f
fix: always display the results in the `%%bqsql` cell magics output (…
tswast 7017e82
feat: Disable progress bars in Anywidget mode to reduce notebook clut…
shuoweil 7d239b6
Revert "feat: Disable progress bars in Anywidget mode to reduce noteb…
tswast fa6f9bc
fix: exlcude gcsfs 2026.2.0 (#2445)
shuoweil 9054fda
tests: Fix global session dependence of astype tests (#2443)
TrevorBergeron 15b2abf
feat: Disable progress bars in Anywidget mode (#2444)
shuoweil 73b3e93
feat: Add bigframes.pandas.col with basic operators (#2405)
TrevorBergeron 3243541
feat: remove redundant "started." messages from progress output (#2440)
tswast 6b81a58
fix: suppress JSONDtypeWarning in Anywidget mode and clean up progres…
shuoweil 2f8fc72
chore: librarian release pull request: 20260207T015024Z (#2446)
shuoweil b5a394b
docs: Add EXIF metadata extraction example to multimodal notebook (#2…
shuoweil d766f14
docs: use direct API for audio transcription (#2447)
shuoweil 51fe640
refactor: Define sql nodes and transform (#2438)
TrevorBergeron bc60fc8
docs: Update multimodal notebook to use public runtime helpers (#2451)
shuoweil 7b57ec6
refactor: add brackets on sqlglot `NOT` expression (#2450)
chelsea-lin 348f22d
feat: add bigquery.ai.generate_table function (#2453)
GarrettWu ac05f59
feat: Initial support for biglake iceberg tables (#2409)
TrevorBergeron 620ed1b
refactor: Enable `SELECT *` optimization in the sqlglot compiler (#2430)
chelsea-lin 3b336e0
refactor: ensure only valid IDs are propagated in identifier remappin…
chelsea-lin 7caf8ce
docs: fix generate_text and generate_table input docs (#2455)
GarrettWu 046b82f
chore: librarian update image pull request: 20260210T185352Z (#2449)
tswast 6e9d60e
docs: use direct API for pdf chunk and pdf extract (#2452)
shuoweil c2eda3e
docs: update multimodal dataframe notebook to use public APIs (#2456)
shuoweil 8c8fe53
refactor: migrate compile_random_sample for sqlglot (#2454)
chelsea-lin 9660357
chore: Update project links for pypi (#2459)
TrevorBergeron 0addff9
refactor: add table aliases to prevent ambiguity in SQLGlotIR (#2458)
chelsea-lin 0ce08bd
chore: librarian release pull request: 20260217T233413Z (#2461)
sycai 9ae0c8a
docs: Add code examples to configuration docstrings (#2352)
google-labs-jules[bot] 6d85df3
chore: replace old partner teams with updated names (#2462)
suztomo 9c33ed4
feat: Update bigquery.ai.generate_table output_schema to allow Mappin…
GarrettWu 0d77a49
refactor: Decorator to take docs rather than inheritance (#2467)
TrevorBergeron 5ee88ab
chore: fix udf text dedent format (#2468)
GarrettWu 004e3c6
fix: allow IsInOp with same dtypes regardless nullable (#2466)
chelsea-lin 7efdf35
feat: add dt.tz_localize() (#2469)
sycai 9a6bd4f
docs: Skip inherited methods, use autosummary only for big classes (#…
TrevorBergeron 5b143c3
docs: Move readme content to new User Guide section (#2464)
TrevorBergeron 86d9216
docs: add bigframes default connection warning (#2471)
GarrettWu 222cddb
feat: Support pd.col expressions with .loc and getitem (#2473)
TrevorBergeron 79d47c3
docs: use direct API for image (#2465)
shuoweil afe8c7c
chore: deprecate Claude 3.5 in the codebase (#2472)
sycai 267d86d
docs: add code sample and docstring for bpd.options.experiments.sql_c…
tswast f6e45d2
test: Fix prerelease and pandas 3.0 test compat (#2457)
TrevorBergeron 3d89348
feat: add support for Python 3.14 (#2232)
parthea e79e449
chore: Migrate gsutil usage to gcloud storage (#2412)
bhandarivijay-png 514eb5f
tests: remove gemini 2.0 exp model tests, move llm tests to large sui…
GarrettWu a3bd839
feat: add display.render_mode to control DataFrame/Series visualizati…
shuoweil cbfc415
chore: modularize GEMINI.md file (#2479)
GarrettWu 660ba94
docs: Fix recall_score doc example (#2477)
TrevorBergeron 1ac793b
fix: upload local data through write API if nested JSONs detected (#2…
chelsea-lin 62d8641
tests: add multimodal snippets tests (#2476)
GarrettWu 5ee7992
refactor: remove the googlesql module (#2482)
chelsea-lin 88178f2
chore: clean up remaining python 3.9 support codes (#2486)
chelsea-lin d875e13
feat: Support pd.col simple aggregates (#2480)
TrevorBergeron 3c9d3f7
feat: Add cloud_function_cpus option to remote_function (#2475)
TrevorBergeron 6a37760
chore: librarian update image pull request: 20260303T000950Z (#2487)
chelsea-lin 72b1c96
chore: librarian release pull request: 20260303T181914Z (#2489)
chelsea-lin c62cfd9
test: align remote function ingress with new GCP policies (#2490)
chelsea-lin 24bb505
refactor: decouple SQL building logic from sqlglot_ir (#2491)
chelsea-lin e8f57ba
feat: Add str, dt accessors to pd.col Expression objects (#2488)
TrevorBergeron d03d1da
feat: add bigquery.ml.get_insights function (#2493)
GarrettWu 10f6992
chore(deps): bump @tootallnate/once and jest-environment-jsdom in /te…
dependabot[bot] 5da7c3c
docs: Fix typo in ExperimentOptions class docstring (#2498)
tswast 3603b52
chore: fix google3 import colabsqlviz tests (#2499)
GarrettWu 0e81b95
feat: Add `bigframes.bigquery.rand()` function (#2501)
tswast bbfe36d
refactor: Define CTE-related SQL nodes for emitter (#2495)
TrevorBergeron a39313f
refactor: use sqlglot to build literal (#2500)
chelsea-lin 2f1a153
fix: no longer automatically use anywidget in the `%%bqsql` magics (#…
tswast 9966d2d
test: add golden sql tests for TPC-H queries (#2503)
chelsea-lin 0dd4d83
feat: use EUC for AI IF, CLASSIFY, and SCORE when connection is not p…
sycai 9590f90
refactor: implement iterative top-down traversal (#2508)
chelsea-lin e9f0cc4
docs: add notebooks to user guide page (#2505)
tswast 36878fb
feat: add `df.bigquery` pandas accessor (#2513)
tswast 21df7b0
fix: handle unsupported types and empty results in describe (#2506)
shuoweil b6e4751
refactor: fix test_dt_tz_localize in the sqlglot compiler (#2517)
chelsea-lin 18476ca
refactor: use sqlglot to build load_data ddl (#2515)
chelsea-lin e50c591
chore: librarian release pull request: 20260316T210518Z (#2520)
tswast 0cc87db
docs: gemini retouch of the index page for seo (#2514)
tswast 1cbc76f
test: Fix ingress settings for vpc tests to not use "all" (#2519)
TrevorBergeron 920ba66
chore: Remove unused Ibis Python to JS UDF compiler (#2521)
tswast b9ca0d6
feat: add `df.bigquery.ai.forecast` method to pandas dataframe access…
tswast b493f56
test: Update ARIMA PLUS score tests to ignore future BQML column addi…
shuoweil f548b06
feat: support full round-trip persistence for multimodal reference co…
shuoweil 5519f4c
refactor: use sqlglot to build create_external_table ddl (#2523)
chelsea-lin e463eb4
refactor: Improve cache encapsulation (#2525)
TrevorBergeron 8da1430
test: Remove ingress setting all test (#2528)
TrevorBergeron 1b0182d
chore: include pandas accessors in api logging (#2524)
tswast 0c17585
fix: support melting empty DataFrames without crashing (#2509)
shuoweil 25c2309
refactor: increase test coverages on sqlglot compiler (#2527)
chelsea-lin 5d1436d
perf: Make executor data uploads async internally (#2529)
TrevorBergeron d240707
fix: Respect remote function config changes even if logic unchanged (…
TrevorBergeron 9f03614
fix: to_gbq may swap data columns when replace table (#2532)
chelsea-lin 6deb427
feat: expose DataFrame.bigquery in both pandas and bigframes DataFram…
tswast 3eb9489
docs: Rename Blob column references to ObjectRef column (#2535)
tswast 3cac5d8
refactor: Simplify @udf code (#2539)
TrevorBergeron fee34a3
chore: add a notebook about using AI functions for movie posters (#2537)
sycai 36b5da1
chore: disable "read_csv_for_names" test (#2544)
sycai c9ca0f1
fix: Localize BigQuery log suppression for gbq.py (#2541)
shuoweil ff49d0b
chore: fix null literal check in sqlglot compiler (#2538)
chelsea-lin cb85fb3
fix: handle aggregate operations on empty selections (#2510)
shuoweil 86a83fb
deps: exclude gcsfs 2026.3.0 (#2546)
chelsea-lin 6ff1003
Merge remote-tracking branch 'remote.googleapis/python-bigquery-dataf…
chalmerlowe 4c7d7e2
Trigger owlbot post-processor
chalmerlowe 1f5b70a
build: bigframes migration: adjust owlbot-related files
chalmerlowe 1227121
chore: delete unused directories and files
chalmerlowe 0274eb4
chore: update repo URLs and references and check for Ruff
chalmerlowe a52079f
chore: updates librarian state.yaml with library id and metadata
chalmerlowe 50d6ab9
chore: updates to noxfile sessions, versions and creds check.
chalmerlowe ee9d0f8
chore: adds new constraint-3.9.txt file
chalmerlowe ff3bd77
chore: updates minimum python runtime and trove classifier
chalmerlowe 7c392f4
chore: updates index.rst and adds CHANGELOG symlink
chalmerlowe e7b2584
chore: revert back to 3.10+ support
chalmerlowe 9f0071f
chore: allow 3.9 unittest to avoid CI/CD fail
chalmerlowe d57b832
chore: update mypy and docs Python versions
chalmerlowe bf11582
minor version change to docs session to confirm CI/CD execution
chalmerlowe 5664123
chore: renamed class to avoid name conflict in sphinx
chalmerlowe 0cf38e7
chore: revised noxfile to accommodate sphinx conflicts
chalmerlowe 192c66b
chore: set mypy nox session to skip for now
chalmerlowe dd21f2e
chore: update list of packages that are release blocked to include bi…
chalmerlowe 45cd714
chore: reformat using ruff
chalmerlowe ff0dc5b
Merge branch 'main' into migration.python-bigquery-dataframes.migrati…
chalmerlowe a22bf23
chore: revise imports and import order to account for circular imports
chalmerlowe f726202
chore: update class name _chain to avoid sphinx warning
chalmerlowe 6d43911
chore: update dependencies to avoid docfx error and updates linting
chalmerlowe abf6047
chore: incorporates split repo changes from PR #2547
chalmerlowe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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 |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # | ||
| # Copyright 2024 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 | ||
| # | ||
| # https://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. | ||
|
|
||
| # Generated by synthtool. DO NOT EDIT! | ||
| [run] | ||
| branch = True | ||
| omit = | ||
| google/__init__.py | ||
| google/cloud/__init__.py | ||
|
|
||
| [report] | ||
| fail_under = 35 | ||
| show_missing = True | ||
| exclude_lines = | ||
| # Re-enable the standard pragma | ||
| pragma: NO COVER | ||
| # Ignore debug-only repr | ||
| def __repr__ | ||
| # Ignore abstract methods | ||
| raise NotImplementedError | ||
| omit = | ||
| */gapic/*.py | ||
| */proto/*.py | ||
| */site-packages/*.py | ||
| google/cloud/__init__.py |
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,33 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # | ||
| # Copyright 2024 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 | ||
| # | ||
| # https://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. | ||
|
|
||
| # Generated by synthtool. DO NOT EDIT! | ||
| [flake8] | ||
| ignore = E203, E231, E266, E501, W503 | ||
| exclude = | ||
| # Exclude generated code. | ||
| **/proto/** | ||
| **/gapic/** | ||
| **/services/** | ||
| **/types/** | ||
| *_pb2.py | ||
|
|
||
| # Standard linting exemptions. | ||
| **/.nox/** | ||
| __pycache__, | ||
| .git, | ||
| *.pyc, | ||
| conf.py |
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,8 @@ | ||
| ## Constraints | ||
|
|
||
| - Only add git commits. Do not change git history. | ||
| - Follow the spec file for development. | ||
| - Check off items in the "Acceptance | ||
| criteria" and "Detailed steps" sections with `[x]`. | ||
| - Please do this as they are completed. | ||
| - Refer back to the spec after each step. |
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,9 @@ | ||
| ## Documentation | ||
|
|
||
| If a method or property is implementing the same interface as a third-party | ||
| package such as pandas or scikit-learn, place the relevant docstring in the | ||
| corresponding `third_party/bigframes_vendored/package_name` directory, not in | ||
| the `bigframes` directory. Implementations may be placed in the `bigframes` | ||
| directory, though. | ||
|
|
||
| @../tools/test_docs.md |
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,67 @@ | ||
| ## Adding a scalar operator | ||
|
|
||
| For an example, see commit | ||
| [c5b7fdae74a22e581f7705bc0cf5390e928f4425](https://github.com/googleapis/python-bigquery-dataframes/commit/c5b7fdae74a22e581f7705bc0cf5390e928f4425). | ||
|
|
||
| To add a new scalar operator, follow these steps: | ||
|
|
||
| 1. **Define the operation dataclass:** | ||
| - In `bigframes/operations/`, find the relevant file (e.g., `geo_ops.py` for geography functions) or create a new one. | ||
| - Create a new dataclass inheriting from `base_ops.UnaryOp` for unary | ||
| operators, `base_ops.BinaryOp` for binary operators, `base_ops.TernaryOp` | ||
| for ternary operators, or `base_ops.NaryOp for operators with many | ||
| arguments. Note that these operators are counting the number column-like | ||
| arguments. A function that takes only a single column but several literal | ||
| values would still be a `UnaryOp`. | ||
| - Define the `name` of the operation and any parameters it requires. | ||
| - Implement the `output_type` method to specify the data type of the result. | ||
|
|
||
| 2. **Export the new operation:** | ||
| - In `bigframes/operations/__init__.py`, import your new operation dataclass and add it to the `__all__` list. | ||
|
|
||
| 3. **Implement the user-facing function (pandas-like):** | ||
|
|
||
| - Identify the canonical function from pandas / geopandas / awkward array / | ||
| other popular Python package that this operator implements. | ||
| - Find the corresponding class in BigFrames. For example, the implementation | ||
| for most geopandas.GeoSeries methods is in | ||
| `bigframes/geopandas/geoseries.py`. Pandas Series methods are implemented | ||
| in `bigframes/series.py` or one of the accessors, such as `StringMethods` | ||
| in `bigframes/operations/strings.py`. | ||
| - Create the user-facing function that will be called by users (e.g., `length`). | ||
| - If the SQL method differs from pandas or geopandas in a way that can't be | ||
| made the same, raise a `NotImplementedError` with an appropriate message and | ||
| link to the feedback form. | ||
| - Add the docstring to the corresponding file in | ||
| `third_party/bigframes_vendored`, modeled after pandas / geopandas. | ||
|
|
||
| 4. **Implement the user-facing function (SQL-like):** | ||
|
|
||
| - In `bigframes/bigquery/_operations/`, find the relevant file (e.g., `geo.py`) or create a new one. | ||
| - Create the user-facing function that will be called by users (e.g., `st_length`). | ||
| - This function should take a `Series` for any column-like inputs, plus any other parameters. | ||
| - Inside the function, call `series._apply_unary_op`, | ||
| `series._apply_binary_op`, or similar passing the operation dataclass you | ||
| created. | ||
| - Add a comprehensive docstring with examples. | ||
| - In `bigframes/bigquery/__init__.py`, import your new user-facing function and add it to the `__all__` list. | ||
|
|
||
| 5. **Implement the compilation logic:** | ||
| - In `bigframes/core/compile/scalar_op_compiler.py`: | ||
| - If the BigQuery function has a direct equivalent in Ibis, you can often reuse an existing Ibis method. | ||
| - If not, define a new Ibis UDF using `@ibis_udf.scalar.builtin` to map to the specific BigQuery function signature. | ||
| - Create a new compiler implementation function (e.g., `geo_length_op_impl`). | ||
| - Register this function to your operation dataclass using `@scalar_op_compiler.register_unary_op` or `@scalar_op_compiler.register_binary_op`. | ||
| - This implementation will translate the BigQuery DataFrames operation into the appropriate Ibis expression. | ||
|
|
||
| 6. **Add Tests:** | ||
| - Add system tests in the `tests/system/` directory to verify the end-to-end | ||
| functionality of the new operator. Test various inputs, including edge cases | ||
| and `NULL` values. | ||
|
|
||
| Where possible, run the same test code against pandas or GeoPandas and | ||
| compare that the outputs are the same (except for dtypes if BigFrames | ||
| differs from pandas). | ||
| - If you are overriding a pandas or GeoPandas property, add a unit test to | ||
| ensure the correct behavior (e.g., raising `NotImplementedError` if the | ||
| functionality is not supported). |
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,18 @@ | ||
| ## Code Style with nox | ||
|
|
||
| - We use the automatic code formatter `black`. You can run it using | ||
| the nox session `format`. This will eliminate many lint errors. Run via: | ||
|
|
||
| ```bash | ||
| nox -r -s format | ||
| ``` | ||
|
|
||
| - PEP8 compliance is required, with exceptions defined in the linter configuration. | ||
| If you have ``nox`` installed, you can test that you have not introduced | ||
| any non-compliant code via: | ||
|
|
||
| ``` | ||
| nox -r -s lint | ||
| ``` | ||
|
|
||
| - When writing tests, use the idiomatic "pytest" style. |
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,10 @@ | ||
| ## Testing code samples | ||
|
|
||
| Code samples are very important for accurate documentation. We use the "doctest" | ||
| framework to ensure the samples are functioning as expected. After adding a code | ||
| sample, please ensure it is correct by running doctest. To run the samples | ||
| doctests for just a single method, refer to the following example: | ||
|
|
||
| ```bash | ||
| pytest --doctest-modules bigframes/pandas/__init__.py::bigframes.pandas.cut | ||
| ``` |
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,28 @@ | ||
| ## Testing with nox | ||
|
|
||
| Use `nox` to instrument our tests. | ||
|
|
||
| - To test your changes, run unit tests with `nox`: | ||
|
|
||
| ```bash | ||
| nox -r -s unit | ||
| ``` | ||
|
|
||
| - To run a single unit test: | ||
|
|
||
| ```bash | ||
| nox -r -s unit-3.14 -- -k <name of test> | ||
| ``` | ||
|
|
||
| - Ignore this step if you lack access to Google Cloud resources. To run system | ||
| tests, you can execute:: | ||
|
|
||
| # Run all system tests | ||
| $ nox -r -s system | ||
|
|
||
| # Run a single system test | ||
| $ nox -r -s system-3.14 -- -k <name of test> | ||
|
|
||
| - The codebase must have better coverage than it had previously after each | ||
| change. You can test coverage via `nox -s unit system cover` (takes a long | ||
| time). Omit `system` if you lack access to cloud resources. |
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,9 @@ | ||
| ## Testing with pytest | ||
|
|
||
| Use `pytest` to instrument our tests. | ||
|
|
||
| - To test your changes, run `pytest`: | ||
|
|
||
| ```bash | ||
| pytest <test_file>::<test_case> | ||
| ``` |
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,7 @@ | ||
| [settings] | ||
| profile=black | ||
| force_sort_within_sections=True | ||
| lexicographical=True | ||
| single_line_exclusions=('typing',) | ||
| order_by_type=False | ||
| group_by_package=True |
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,16 @@ | ||
| { | ||
| "name": "bigframes", | ||
| "name_pretty": "A unified Python API in BigQuery", | ||
| "product_documentation": "https://cloud.google.com/bigquery", | ||
| "client_documentation": "https://cloud.google.com/python/docs/reference/bigframes/latest", | ||
| "issue_tracker": "https://github.com/googleapis/python-bigquery-dataframes/issues", | ||
| "release_level": "preview", | ||
| "language": "python", | ||
| "library_type": "INTEGRATION", | ||
| "repo": "googleapis/google-cloud-python", | ||
| "distribution_name": "bigframes", | ||
| "api_id": "bigquery.googleapis.com", | ||
| "default_version": "", | ||
| "codeowner_team": "@googleapis/bigquery-dataframe-team", | ||
| "api_shortname": "bigquery" | ||
| } |
Oops, something went wrong.
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.
Looks like this is a conflict indicator.