Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/python-bigquery-dataframes
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11.0
Choose a base ref
...
head repository: googleapis/python-bigquery-dataframes
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.12.0
Choose a head ref

Commits on Oct 26, 2023

  1. Revert "ci: Disable presubmit LLM tests temporarily (#144)" (#148)

    This reverts commit 1641aff, which was merged due to automerge label while still being discussed.
    
    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    shobsi authored Oct 26, 2023
    Copy the full SHA
    ade505c View commit details
  2. refactor: make to_pandas() call to_arrow() and use local dtypes i…

    …n DataFrame construction (#132)
    
    Towards internal issue 280662868
    🦕
    tswast authored Oct 26, 2023
    Copy the full SHA
    bfd49a5 View commit details
  3. test: Log slowest tests durations (#146)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    shobsi authored Oct 26, 2023
    Copy the full SHA
    d423e10 View commit details
  4. docs: link to ML.EVALUATE BQML page for score() methods (#137)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    ashleyxuu authored Oct 26, 2023
    Copy the full SHA
    45c617f View commit details
  5. feat: populate ibis version in user agent (#140)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    ashleyxuu authored Oct 26, 2023
    Copy the full SHA
    c639a36 View commit details
  6. fix: don't override the global logging config (#138)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    tswast authored Oct 26, 2023
    Copy the full SHA
    2ddbf74 View commit details
  7. fix: use indexee's session for loc listlike cases (#152)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    milkshakeiii authored Oct 26, 2023
    Copy the full SHA
    27c5725 View commit details
  8. feat: add pandas.qcut (#104)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    TrevorBergeron authored Oct 26, 2023
    Copy the full SHA
    8e44518 View commit details
  9. feat: add unstack to series, add level param (#115)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    TrevorBergeron authored Oct 26, 2023
    Copy the full SHA
    5edcd19 View commit details
  10. Copy the full SHA
    3afd4a3 View commit details
  11. fix: resolve plotly rendering issue by using ipython html for job pro… (

    #134)
    
    …gress messages
    
    Fixes bug that was preventing plotly rendering to show after the progress bar. Original ipywidgets implementation isn't necessary for basic opening of urls
    
    Screen recording: https://togithub.com/googleapis/python-bigquery-dataframes/assets/15842009/5225ce05-117a-4808-9ff0-cb2c3aaf3a40
    
    Internal bug: b/297062404
    orrbradford authored Oct 26, 2023
    Copy the full SHA
    39df43e View commit details

Commits on Oct 27, 2023

  1. refactor: ArrayValue is now a tree that defers conversion to ibis (#110)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    TrevorBergeron authored Oct 27, 2023
    Copy the full SHA
    eceeb22 View commit details
  2. fix: fix bug with column names under repeated column assignment (#150)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    milkshakeiii authored Oct 27, 2023
    Copy the full SHA
    29032d0 View commit details
  3. test: refactor remote function tests (#147)

    This changes moves the tests that deploy cloud function to large remote function tests, and the tests that do not make call to bigquery service to unit tests.
    
    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    shobsi authored Oct 27, 2023
    Copy the full SHA
    2d7128d View commit details

Commits on Oct 28, 2023

  1. feat: add dataframe melt (#116)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    TrevorBergeron authored Oct 28, 2023
    Copy the full SHA
    4e4409c View commit details

Commits on Oct 30, 2023

  1. docs: add artithmetic df sample code (#153)

    * docs: add artithmetic df sample code
    
    * fix: address comments
    ashleyxuu authored Oct 30, 2023
    Copy the full SHA
    ac44ccd View commit details
  2. feat: Implement operator @ for DataFrame.dot (#139)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes b/297502513 🦕
    shobsi authored Oct 30, 2023
    Copy the full SHA
    79a638e View commit details

Commits on Oct 31, 2023

  1. test: add code snippets for loading data from BigQuery Job (#154)

    * test: add code snippets for loading data from BigQuery Job
    
    * fix: address the comments
    
    * fix: fix the broken test
    
    * use BigQuery Client library to get the job_id
    
    * feat: Implement operator `@` for `DataFrame.dot` (#139)
    
    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes b/297502513 🦕
    
    * fix: fix the comments
    
    ---------
    
    Co-authored-by: Shobhit Singh <shobs@google.com>
    ashleyxuu and shobsi authored Oct 31, 2023
    Copy the full SHA
    cfebfaa View commit details
  2. feat: add bigframes.options.compute.maximum_bytes_billed option that …

    …sets maximum bytes billed on query jobs (#133)
    
    -implement context manager for global options
    -maximum_bytes_billed only applies to query jobs. This limitation will be set per query. Operations that trigger multiple jobs may result in total usage beyond this setting
    orrbradford authored Oct 31, 2023
    Copy the full SHA
    63c7919 View commit details
  3. docs: fix indentation on read_gbq_function code sample (#163)

    Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
    - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
    - [ ] Ensure the tests and linter pass
    - [ ] Code coverage does not decrease (if any source code was changed)
    - [ ] Appropriate docs were updated (if necessary)
    
    Fixes #<issue_number_goes_here> 🦕
    tswast authored Oct 31, 2023
    Copy the full SHA
    0801d96 View commit details

Commits on Nov 1, 2023

  1. feat: add pd.get_dummies (#149)

    * feat: add pd.get_dummies
    
    * remove unneeded prefix case
    
    * param/documentation fixes
    
    * be stricter about types in test
    
    * be stricter about types in series test
    
    * remove unneeded comment
    
    * adjust for type difference in pandas 1
    
    * add example code (tested)
    
    * fix None columns and add test cases
    
    * variable names and _get_unique_values per-column
    
    * account for pandas 1 behavior difference
    
    * remove already_seen set
    
    * avoid unnecessary join/projection
    
    * fix column ordering edge case
    
    * adjust for picky examples checker
    
    * example tweak
    
    * make part of the example comments
    
    * use ellipsis in doctest comment
    
    * add <BLANKLINES> to doctest string
    
    * extract parameter standardization
    
    * extract submethods
    
    ---------
    
    Co-authored-by: Henry J Solberg <henryjsolberg@google.com>
    milkshakeiii and Henry J Solberg authored Nov 1, 2023
    Copy the full SHA
    d8baad5 View commit details
  2. chore(main): release 0.12.0 (#151)

    Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
    release-please[bot] authored Nov 1, 2023
    Copy the full SHA
    bf1ec89 View commit details
Showing with 4,484 additions and 1,598 deletions.
  1. +29 −0 CHANGELOG.md
  2. +2 −1 bigframes/__init__.py
  3. +11 −0 bigframes/_config/__init__.py
  4. +35 −0 bigframes/_config/compute_options.py
  5. +9 −14 bigframes/_config/display_options.py
  6. +0 −3 bigframes/clients.py
  7. +216 −1,005 bigframes/core/__init__.py
  8. +13 −12 bigframes/core/block_transforms.py
  9. +110 −57 bigframes/core/blocks.py
  10. +21 −0 bigframes/core/compile/__init__.py
  11. +1,121 −0 bigframes/core/compile/compiled.py
  12. +185 −0 bigframes/core/compile/compiler.py
  13. +7 −7 bigframes/core/{joins → compile}/row_identity.py
  14. +17 −18 bigframes/core/{joins → compile}/single_column.py
  15. +10 −10 bigframes/core/groupby/__init__.py
  16. +8 −3 bigframes/core/indexers.py
  17. +7 −9 bigframes/core/indexes/index.py
  18. +2 −7 bigframes/core/joins/__init__.py
  19. +245 −0 bigframes/core/nodes.py
  20. +2 −2 bigframes/core/ordering.py
  21. +33 −0 bigframes/core/reshape/__init__.py
  22. +35 −0 bigframes/core/window_spec.py
  23. +74 −43 bigframes/dataframe.py
  24. +6 −0 bigframes/dtypes.py
  25. +16 −8 bigframes/formatting_helpers.py
  26. +12 −0 bigframes/ml/ensemble.py
  27. +6 −0 bigframes/ml/forecasting.py
  28. +1 −1 bigframes/ml/metrics.py
  29. +51 −0 bigframes/operations/aggregations.py
  30. +1 −3 bigframes/operations/base.py
  31. +194 −0 bigframes/pandas/__init__.py
  32. +0 −5 bigframes/remote_function.py
  33. +41 −33 bigframes/series.py
  34. +52 −37 bigframes/session/__init__.py
  35. +89 −0 bigframes/session/_io/pandas.py
  36. +2 −1 bigframes/session/clients.py
  37. +1 −1 bigframes/version.py
  38. +2 −0 docs/reference/bigframes/options.rst
  39. +2 −0 docs/templates/toc.yml
  40. +3 −1 noxfile.py
  41. +51 −0 samples/snippets/load_data_from_biquery_job_test.py
  42. +6 −9 tests/system/conftest.py
  43. +90 −0 tests/system/large/test_remote_function.py
  44. +0 −24 tests/system/small/ml/test_llm.py
  45. +104 −14 tests/system/small/test_dataframe.py
  46. +8 −0 tests/system/small/test_dataframe_io.py
  47. +71 −4 tests/system/small/test_multiindex.py
  48. +137 −0 tests/system/small/test_pandas.py
  49. +47 −57 tests/system/small/test_progress_bar.py
  50. +30 −126 tests/system/small/test_remote_function.py
  51. +39 −13 tests/system/small/test_series.py
  52. +2 −7 tests/system/small/test_session.py
  53. +1 −4 tests/unit/core/test_blocks.py
  54. +12 −5 tests/unit/resources.py
  55. +352 −0 tests/unit/session/test_io_pandas.py
  56. +30 −0 tests/unit/test_compute_options.py
  57. +22 −15 tests/unit/test_core.py
  58. +29 −28 tests/unit/test_dtypes.py
  59. +28 −0 tests/unit/test_remote_function.py
  60. +45 −0 third_party/bigframes_vendored/pandas/_config/config.py
  61. +518 −4 third_party/bigframes_vendored/pandas/core/frame.py
  62. +1 −1 third_party/bigframes_vendored/pandas/core/reshape/concat.py
  63. +119 −0 third_party/bigframes_vendored/pandas/core/reshape/encoding.py
  64. +0 −1 third_party/bigframes_vendored/pandas/core/reshape/merge.py
  65. +31 −1 third_party/bigframes_vendored/pandas/core/reshape/tile.py
  66. +13 −0 third_party/bigframes_vendored/pandas/core/series.py
  67. +13 −1 third_party/bigframes_vendored/sklearn/base.py
  68. +7 −2 third_party/bigframes_vendored/sklearn/cluster/_kmeans.py
  69. +7 −1 third_party/bigframes_vendored/sklearn/decomposition/_pca.py
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,35 @@

[1]: https://pypi.org/project/bigframes/#history

## [0.12.0](https://github.com/googleapis/python-bigquery-dataframes/compare/v0.11.0...v0.12.0) (2023-11-01)


### Features

* Add `DataFrame.melt` ([#113](https://github.com/googleapis/python-bigquery-dataframes/issues/113)) ([4e4409c](https://github.com/googleapis/python-bigquery-dataframes/commit/4e4409c5b235171f3770aec852193026519948fd))
* Add `DataFrame.to_pandas_batches()` to download large `DataFrame` objects ([#136](https://github.com/googleapis/python-bigquery-dataframes/issues/136)) ([3afd4a3](https://github.com/googleapis/python-bigquery-dataframes/commit/3afd4a35f4c38dad86dab17ff62444cd418cab88))
* Add bigframes.options.compute.maximum_bytes_billed option that sets maximum bytes billed on query jobs ([#133](https://github.com/googleapis/python-bigquery-dataframes/issues/133)) ([63c7919](https://github.com/googleapis/python-bigquery-dataframes/commit/63c7919e28d2e0b864142320b47374d807f07c03))
* Add pandas.qcut ([#104](https://github.com/googleapis/python-bigquery-dataframes/issues/104)) ([8e44518](https://github.com/googleapis/python-bigquery-dataframes/commit/8e4451841ba09099b0ed5433f9102511741dfbed))
* Add pd.get_dummies ([#149](https://github.com/googleapis/python-bigquery-dataframes/issues/149)) ([d8baad5](https://github.com/googleapis/python-bigquery-dataframes/commit/d8baad5b71ec67a35a0fb6132ee16e4c7418c456))
* Add unstack to series, add level param ([#115](https://github.com/googleapis/python-bigquery-dataframes/issues/115)) ([5edcd19](https://github.com/googleapis/python-bigquery-dataframes/commit/5edcd19e6200db9b9ebe3d4945816b3ebf1f7bcd))
* Implement operator `@` for `DataFrame.dot` ([#139](https://github.com/googleapis/python-bigquery-dataframes/issues/139)) ([79a638e](https://github.com/googleapis/python-bigquery-dataframes/commit/79a638eda80c482b640b523426ffd95c42747edc))
* Populate ibis version in user agent ([#140](https://github.com/googleapis/python-bigquery-dataframes/issues/140)) ([c639a36](https://github.com/googleapis/python-bigquery-dataframes/commit/c639a3657465e2b68a3b93c363bd3ae1e969d2cc))


### Bug Fixes

* Don't override the global logging config ([#138](https://github.com/googleapis/python-bigquery-dataframes/issues/138)) ([2ddbf74](https://github.com/googleapis/python-bigquery-dataframes/commit/2ddbf743efc2fd8ffb61ae8d3333fc4b98ce4b55))
* Fix bug with column names under repeated column assignment ([#150](https://github.com/googleapis/python-bigquery-dataframes/issues/150)) ([29032d0](https://github.com/googleapis/python-bigquery-dataframes/commit/29032d06811569121f7be2a7de915740df7daf6e))
* Resolve plotly rendering issue by using ipython html for job pro… ([#134](https://github.com/googleapis/python-bigquery-dataframes/issues/134)) ([39df43e](https://github.com/googleapis/python-bigquery-dataframes/commit/39df43e243ac0374d1a1eb2a75779324825afbe9))
* Use indexee's session for loc listlike cases ([#152](https://github.com/googleapis/python-bigquery-dataframes/issues/152)) ([27c5725](https://github.com/googleapis/python-bigquery-dataframes/commit/27c57255c7fe11e1ef9b9826d988d80fc17442a6))


### Documentation

* Add artithmetic df sample code ([#153](https://github.com/googleapis/python-bigquery-dataframes/issues/153)) ([ac44ccd](https://github.com/googleapis/python-bigquery-dataframes/commit/ac44ccd3936cdb28755d2bbe16377d489f08d5e5))
* Fix indentation on `read_gbq_function` code sample ([#163](https://github.com/googleapis/python-bigquery-dataframes/issues/163)) ([0801d96](https://github.com/googleapis/python-bigquery-dataframes/commit/0801d96830dab467232277dea9fd2dacee41055c))
* Link to ML.EVALUATE BQML page for score() methods ([#137](https://github.com/googleapis/python-bigquery-dataframes/issues/137)) ([45c617f](https://github.com/googleapis/python-bigquery-dataframes/commit/45c617fee7becc42f1c129246ffdc32f3a963f12))

## [0.11.0](https://github.com/googleapis/python-bigquery-dataframes/compare/v0.10.0...v0.11.0) (2023-10-26)


3 changes: 2 additions & 1 deletion bigframes/__init__.py
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@

"""BigQuery DataFrames provides a DataFrame API scaled by the BigQuery engine."""

from bigframes._config import options
from bigframes._config import option_context, options
from bigframes._config.bigquery_options import BigQueryOptions
from bigframes.core.global_session import close_session, get_global_session
from bigframes.session import connect, Session
@@ -28,4 +28,5 @@
"connect",
"Session",
"__version__",
"option_context",
]
11 changes: 11 additions & 0 deletions bigframes/_config/__init__.py
Original file line number Diff line number Diff line change
@@ -18,8 +18,10 @@
"""

import bigframes._config.bigquery_options as bigquery_options
import bigframes._config.compute_options as compute_options
import bigframes._config.display_options as display_options
import bigframes._config.sampling_options as sampling_options
import third_party.bigframes_vendored.pandas._config.config as pandas_config


class Options:
@@ -29,6 +31,7 @@ def __init__(self):
self._bigquery_options = bigquery_options.BigQueryOptions()
self._display_options = display_options.DisplayOptions()
self._sampling_options = sampling_options.SamplingOptions()
self._compute_options = compute_options.ComputeOptions()

@property
def bigquery(self) -> bigquery_options.BigQueryOptions:
@@ -49,6 +52,11 @@ def sampling(self) -> sampling_options.SamplingOptions:
parameters in specific functions."""
return self._sampling_options

@property
def compute(self) -> compute_options.ComputeOptions:
"""Options controlling object computation."""
return self._compute_options


options = Options()
"""Global options for default session."""
@@ -58,3 +66,6 @@ def sampling(self) -> sampling_options.SamplingOptions:
"Options",
"options",
)


option_context = pandas_config.option_context
35 changes: 35 additions & 0 deletions bigframes/_config/compute_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2023 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.

"""Options for displaying objects."""

import dataclasses
from typing import Optional


@dataclasses.dataclass
class ComputeOptions:
"""
Encapsulates configuration for compute options.
Attributes:
maximum_bytes_billed (int, Options):
Limits the bytes billed for query jobs. Queries that will have
bytes billed beyond this limit will fail (without incurring a
charge). If unspecified, this will be set to your project default.
See `maximum_bytes_billed <https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJobConfig#google_cloud_bigquery_job_QueryJobConfig_maximum_bytes_billed>`_.
"""

maximum_bytes_billed: Optional[int] = None
23 changes: 9 additions & 14 deletions bigframes/_config/display_options.py
Original file line number Diff line number Diff line change
@@ -40,17 +40,12 @@ def pandas_repr(display_options: DisplayOptions):
This context manager makes sure we reset the pandas options when we're done
so that we don't override pandas behavior.
"""
original_max_cols = pd.options.display.max_columns
original_max_rows = pd.options.display.max_rows
original_show_dimensions = pd.options.display.show_dimensions

pd.options.display.max_columns = display_options.max_columns
pd.options.display.max_rows = display_options.max_rows
pd.options.display.show_dimensions = True # type: ignore

try:
yield
finally:
pd.options.display.max_columns = original_max_cols
pd.options.display.max_rows = original_max_rows
pd.options.display.show_dimensions = original_show_dimensions
with pd.option_context(
"display.max_columns",
display_options.max_columns,
"display.max_rows",
display_options.max_rows,
"display.show_dimensions",
True,
) as pandas_context:
yield (pandas_context)
3 changes: 0 additions & 3 deletions bigframes/clients.py
Original file line number Diff line number Diff line change
@@ -24,9 +24,6 @@
from google.cloud import bigquery_connection_v1, resourcemanager_v3
from google.iam.v1 import iam_policy_pb2, policy_pb2

logging.basicConfig(
level=logging.INFO, format="[%(levelname)s][%(asctime)s][%(name)s] %(message)s"
)
logger = logging.getLogger(__name__)


Loading