Skip to content

docs: use direct API for image - #2465

Merged
shuoweil merged 14 commits into
mainfrom
shuowei-blob-image
Feb 23, 2026
Merged

docs: use direct API for image#2465
shuoweil merged 14 commits into
mainfrom
shuowei-blob-image

Conversation

@shuoweil

@shuoweilshuoweil commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

This PR updates notebooks/multimodal/multimodal_dataframe.ipynb to demonstrate image modifications using custom BigQuery Python UDFs with the opencv library.

verified at: screen/BfesAowVQWEGsCf

Fixes #<478952827> 🦕

@shuoweilshuoweil self-assigned this Feb 18, 2026
@shuoweil
shuoweil requested a review from a team as a code ownerFebruary 18, 2026 22:13
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@product-auto-labelproduct-auto-labelBot added size: xl Pull request size is extra large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 18, 2026
@@ -2,7 +2,7 @@
"cells": [

@GarrettWuGarrettWuFeb 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #7. # df = bpd.read_gbq_object_table("", name="blob_col")

this can remove too.


Reply via ReviewNB

@@ -2,7 +2,7 @@
"cells": [

@GarrettWuGarrettWuFeb 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #2. display_blob(df_image[df_image["author"] == "alice"]["image"])

We still keep preview in _repr_html_, don't need this.


Reply via ReviewNB

@@ -2,7 +2,7 @@
"cells": [

@GarrettWuGarrettWuFeb 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #22. try: 

Now the functions only serve the purpose as examples. We probably don't want to make them too complex. We can remove those try-catch and retry logics, only keep the core part.

Also we can remove other images functions, maybe just keep one is enough.


Reply via ReviewNB

@shuoweilshuoweilFeb 19, 2026

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified all transformation functions (image_blur, pdf_extract, etc.) by removing retry logic and try-except blocks, while keeping requests.Session() for connection stability. Removed image_resize and image_normalize to focus on the core example

@product-auto-labelproduct-auto-labelBot added size: l Pull request size is large. and removed size: xl Pull request size is extra large. labels Feb 20, 2026
@@ -83,7 +83,7 @@
},

@GarrettWuGarrettWuFeb 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #13. src_rt: str, dst_rt: str, ext: str, kx: int, ky: int, verbose: bool

lets remove the ext and verbose to keep the function simple. Just use png or jpeg whichever is fine.


Reply via ReviewNB

@@ -83,7 +83,7 @@
},

@GarrettWuGarrettWuFeb 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #22. session = requests.Session()

session is for retry and timeout, we can remove too to keep the function simple


Reply via ReviewNB

@shuoweil
shuoweil merged commit 8a1a82f into mainFeb 23, 2026
23 of 24 checks passed
@shuoweil
shuoweil deleted the shuowei-blob-image branch February 23, 2026 18:40
chelsea-lin added a commit that referenced this pull request Mar 4, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.
Librarian Version: v0.8.3
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:160860d189ff1c2f7515638478823712fa5b243e27ccc33a2728669fa1e2ed0c
<details><summary>bigframes: v2.37.0</summary>
##
[v2.37.0](v2.36.0...v2.37.0)
(2026-03-03)
### Features
* Add cloud_function_cpus option to remote_function (#2475)
([4caf74c](4caf74cc))
* add display.render_mode to control DataFrame/Series visualization
(#2413)
([7813eaa](7813eaa6))
* Support pd.col expressions with .loc and getitem (#2473)
([ae5c8b3](ae5c8b32))
* add support for Python 3.14 (#2232)
([c25a6d0](c25a6d01))
* Support pd.col simple aggregates (#2480)
([cb00daa](cb00daab))
* add dt.tz_localize() (#2469)
([f70f93a](f70f93a1))
* Update bigquery.ai.generate_table output_schema to allow Mapping type
(#2463)
([f7fd189](f7fd1895))
### Bug Fixes
* upload local data through write API if nested JSONs detected (#2478)
([01dc5a3](01dc5a34))
* allow IsInOp with same dtypes regardless nullable (#2466)
([1d81b41](1d81b414))
### Documentation
* Add code examples to configuration docstrings (#2352)
([3c21993](3c21993e))
* Move readme content to new User Guide section (#2464)
([61a9484](61a94845))
* add code sample and docstring for bpd.options.experiments.sql_compiler
(#2474)
([867951b](867951bc))
* use direct API for image (#2465)
([8a1a82f](8a1a82f7))
* Fix recall_score doc example (#2477)
([a6f499c](a6f499c1))
* Skip inherited methods, use autosummary only for big classes (#2470)
([a951249](a9512498))
* add bigframes default connection warning (#2471)
([f1bbba2](f1bbba23))
</details>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigqueryIssues related to the googleapis/python-bigquery-dataframes API.size: lPull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@shuoweil@GarrettWu