Skip to content

Comments

docs: use direct API for image#2465

Open
shuoweil wants to merge 14 commits intomainfrom
shuowei-blob-image
Open

docs: use direct API for image#2465
shuoweil wants to merge 14 commits intomainfrom
shuowei-blob-image

Conversation

@shuoweil
Copy link
Contributor

@shuoweil shuoweil commented Feb 18, 2026

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> 🦕

@shuoweil shuoweil requested a review from GarrettWu February 18, 2026 22:13
@shuoweil shuoweil self-assigned this Feb 18, 2026
@shuoweil shuoweil requested a review from a team as a code owner February 18, 2026 22:13
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@product-auto-label product-auto-label bot 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": [
Copy link
Contributor

@GarrettWu GarrettWu Feb 19, 2026

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": [
Copy link
Contributor

@GarrettWu GarrettWu Feb 19, 2026

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": [
Copy link
Contributor

@GarrettWu GarrettWu Feb 19, 2026

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

Copy link
Contributor Author

@shuoweil shuoweil Feb 19, 2026

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-label product-auto-label bot added size: l Pull request size is large. and removed size: xl Pull request size is extra large. labels Feb 20, 2026
@shuoweil shuoweil requested a review from GarrettWu February 20, 2026 03:38
@@ -83,7 +83,7 @@
},
Copy link
Contributor

@GarrettWu GarrettWu Feb 20, 2026

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 @@
},
Copy link
Contributor

@GarrettWu GarrettWu Feb 20, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants