Skip to content

Conversation

@pull
Copy link

@pull pull bot commented May 14, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label May 14, 2024
chelsea-lin and others added 29 commits September 12, 2025 16:42
Co-authored-by: Tim Sweña (Swast) <swast@google.com>
* feat: Add ai_generate_bool to the bigframes.bigquery package

* fix stuffs

* Fix format

* fix doc format

* fix format

* fix code

* expose ai module and rename the function

* add ai module to doc

* fix test

* fix test

* Update bigframes/bigquery/_operations/ai.py

Co-authored-by: Tim Sweña (Swast) <swast@google.com>

---------

Co-authored-by: Tim Sweña (Swast) <swast@google.com>
…tements (#2071)

* fix: return a DataFrame containing query stats for all non-SELECT statements

* return some results in SCRIPT if the last statement is a SELECT
* fix: deflake ai_gen_bool multimodel test

* fix lint

* fix doctest too

* consolidates tests under system/small

* fix doctest
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: allow bigframes.options.bigquery.credentials to be `None`

This is a partial revert of "perf: avoid re-authenticating if
credentials have already been fetched (#2058)", commit
913de1b.

* add unit test
* feat: support 'binary' for precision_score

* add test

* use unique(keep_order=False) to count unique items

* use local variables to hold unique classes

* use concat before checking unique labels

* fix test
This change follows up on #2075 by splitting unary_compiler.py and its unit test file into smaller files.
* feat: support pandas series in ai.generate_bool

* fix mypy error

* define PROMPT_TYPE with Union

* fix type

* update test

* update comment

* fix mypy

* fix return type

* update doc

* fix doctest
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: Transformers with non-standard column names through errors

* fix
* refactor: add agg_ops.MinOp and MaxOp for sqlglot compiler

* allow int timedelta to micro

* address comments
* feat: add `GroupBy.__iter__`

* iterate over keys

* match by key

* implement it

* refactor

* revert notebook change
GarrettWu and others added 30 commits December 11, 2025 14:04
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://github.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> 🦕
This PR fix the _get_anywidget_bundle method. Previously, when the
underlying widget's _repr_mimebundle_ method returned a (data, metadata)
tuple, the code was only extracting the data portion and discarding the
metadata. This resulted in the widget not rendering correctly in
environments like Colab, which rely on this metadata.

The change corrects this by properly unpacking the tuple into
widget_repr and widget_metadata. The method now preserves the metadata
and returns it along with the data, ensuring that the necessary
information for widget rendering is passed on.

We also revert commit 4df3428 to
reapply "refactor: Migrate DataFrame display to use IPython's
repr_mimebundle() protocol for anywidget mode
(#2271)"


A testcase is added to verify this new change. We also verified at
colab: screen/AzGa5RMTJnMH5NH

Fixes #<466155761> 🦕
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://github.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> 🦕
This PR introduces the single column display for anywidget mode.

A screenshot of single index column display is here:
screen/6VLA4Nk68TsYczV

Fixes #<459515995> 🦕
Added conventional-pre-commit hook for commit-msg stage.

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://github.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> 🦕

---------

Co-authored-by: Shenyang Cai <sycai@users.noreply.github.com>
Adds a new notebook, timeseries_analysis.ipynb, to provide a
comprehensive walkthrough of time series forecasting with TimesFM and
ARIMAPlus. The notebook covers data loading, preprocessing, model
training, and visualization of results for both single and multiple time
series.


Fixes #<466169940> 🦕
This change aims to fix some string-related tests failing in #2248.

Fixes internal issue 417774347🦕
This change aims to fix some string-related tests failing in #2248.

Fixes internal issue 417774347 🦕
Updated `scripts/publish_api_coverage.py` to point documentation links
to the new location at `https://dataframes.bigquery.dev/reference/api/`.
The links are now generated as individual HTML pages for each
method/attribute (e.g., `bigframes.pandas.DataFrame.T.html`) instead of
anchors on a single page.
Verified the changes by running `nox -r -s docs` and checking the
generated HTML files.

---
*PR created automatically by Jules for task
[5838600072013437716](https://jules.google.com/task/5838600072013437716)
started by @tswast*

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Tim Sweña (Swast) <swast@google.com>
…n changes (#2342)

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://github.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/469510777 🦕
…t _literal (#2337)

This change can resolve two doctests failures in #2248:
`groupby.GroupBy.rank` and `bigframes.ml.metrics.roc_curve`

Fixes internal issue 417774347🦕

---------

Co-authored-by: Shenyang Cai <sycai@users.noreply.github.com>
This change can resolve three doctests failures in #2248: 
- Added `to_json` support to the compiler backend.
- Fixed minor bugs on AI ops
- Fixed minor bugs on windows compiler

Fixes internal issue 417774347 🦕
…ade (#2349)

This change can fix the `test_get_formatted_time` to avoid the
inconsistent results from the `humanize` package upgrade. Please refer
to the internal screenshot for details: screenshot/BcJFk78xtYtLnyo
This PR focuses on improving the user interface and experience of the
BigFrames Anywidget table display by applying targeted styling and
adding interactive features.

Key changes include:

- **CSS Refinements:**
    - Updated footer styling for better alignment and typography.
- Introduced styling for header content to allow horizontal resizing of
columns.
    - Enhanced the visual presentation of error messages.
- Adjusted default cell padding and added hover styles for rows to
improve readability and visual feedback.

- **JavaScript Enhancements:**
- Implemented a row hover effect that highlights all cells belonging to
a logical row, even if it spans multiple physical table rows (e.g., due
to multi-indexing or exploded array data). This significantly improves
clarity when navigating complex tables.
- Added explicit handling for empty datasets to ensure correct
pagination button states and labels.

This PR aims to deliver a more polished and intuitive table display,
aligning with our coding style guides and enhancing user interaction.

Temporary patch for b/460861328 🦕
This change can resolve the `bigframes.ml.metrics.roc_auc_score`
doctests failures in #2248.

Fixes internal issue 417774347 🦕
)

This change can resolve `read_gbq` doctests failures in #2248.

Fixes internal issue 417774347🦕
This PR refactors DataFrame.to_pandas_batches to return a
blocks.PandasBatches object, improving the handling of streamed data and
total row counts.

  Additionally, this PR updates TableWidget to:
* Utilize the new PandasBatches return type for more robust data
loading.
* Improve thread safety during HTML updates using a re-entrant lock
(RLock), ensuring concurrent
interactions (like rapid sorting or pagination) are handled correctly
without race conditions.
* Fix compatibility with older Python versions by updating type
annotations.
* Refactor index handling logic within the widget for better clarity and
stability.

  User Impact:
* More Stable Interactive Tables: Users experiencing the interactive
table widget in notebooks
     should see more reliable updates when paging or sorting rapidly.
* Internal API Consistency: to_pandas_batches now provides a more
structured return type for
     downstream consumers.

Fixes #<459515995> 🦕
…ull index (#2355)

Fix ML fit ordering issue with partial mode and eval data.

---
*PR created automatically by Jules for task
[4750522966926378079](https://jules.google.com/task/4750522966926378079)
started by @tswast*

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This PR introduces interactive table displays for bigframes.Series
objects, aligning their notebook behavior with bigframes.DataFrame. Now,
when using the "anywidget" display mode, Series are rendered as
interactive tables, significantly improving data exploration.
Additionally, the standard text representation for a Series has been
enhanced to include the total row count, providing more context at a
glance.

  User-Impactful Changes

* Interactive Series Display: When bigframes.options.display.repr_mode
is set to "anywidget", displaying a bigframes.Series in a notebook will
now render an interactive widget. The widget presents the Series as a
two-column table, showing the index and the values.

      Example Usage:
```
    import bigframes.pandas as bpd

    # Enable interactive mode
    bpd.options.display.repr_mode = "anywidget"

    # Create or load a DataFrame
    df = bpd.read_gbq(...)
    series = df["my_column"]

   # Displaying the series will now show an interactive table
   series
```

* Enhanced Text Representation: The default text representation (e.g.,
when using print()) for a bigframes.Series now includes the total number
of rows at the end, similar to DataFrames. For example:
```
   0       a
   1       b
   2       c
   ...
   Name: my_column, Length: 10, dtype: string

   [1000 rows]
```

These changes create a more consistent and intuitive user experience
between Series and DataFrames within notebook environments.

**Verified at:**
- vs code notebook: screen/6QWpRs5nuNESp6e
- colab notebook: screen/4SPpQXtHxk5bRpk

Fixes #<460860439> 🦕

---------

Co-authored-by: Chelsea Lin <chelsealin@google.com>
Co-authored-by: Shenyang Cai <sycai@users.noreply.github.com>
Updates `log_adapter` to optionally store API method names in a
`Session` instance instead of the global list. This improves label
accuracy when running tests in parallel.

- Updates `Session` to initialize `_api_methods` list and lock.
- Updates `log_adapter.add_api_method` and `get_and_reset_api_methods`
to handle session-scoped logging.
- Updates `log_adapter.method_logger` and `property_logger` to identify
the session from arguments.
- Propagates `session` through `start_query_with_client` and its callers
to ensure labels are correctly associated with the session.

---
*PR created automatically by Jules for task
[6421369828766099756](https://jules.google.com/task/6421369828766099756)
started by @tswast*

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Tim Swena <swast@google.com>
This update refactors how the interactive DataFrame widget (anywidget
mode) handles styling. It moves styling logic from Python code into
dedicated CSS classes, making the display system cleaner and more
robust.


Fixes #<issue_number_goes_here> 🦕
Refactors the HTML table generation for DataFrames to use CSS classes
instead of inline styles.
   * Switches from style="text-align: ..." to class="cell-align-...".
   * Uses class="bf-header-content" for header containers.
   * Standardizes null value styling with class="null-value".

Fixes #<438181139> 🦕
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants