Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 7, 2026. It is now read-only.

feat: enhanced multimodal error handling with verbose mode for blob image functions#2024

Merged
shuoweil merged 20 commits into
maingoogleapis/python-bigquery-dataframes:mainfrom
shuowei-add-error-handlinggoogleapis/python-bigquery-dataframes:shuowei-add-error-handlingCopy head branch name to clipboard
Oct 15, 2025
Merged

feat: enhanced multimodal error handling with verbose mode for blob image functions#2024
shuoweil merged 20 commits into
maingoogleapis/python-bigquery-dataframes:mainfrom
shuowei-add-error-handlinggoogleapis/python-bigquery-dataframes:shuowei-add-error-handlingCopy head branch name to clipboard

Conversation

@shuoweil

@shuoweil shuoweil commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

Here are the changes:

  1. Added bool type support
  2. Added verbose parameter to all blob functions - When verbose=True, functions return a structured response with both status (error messages) and content fields. When verbose=False, they return only the content
  3. Enhanced error handling - All functions now wrap their core logic in try-catch blocks and return structured error information.
  4. Updated return types - Functions that previously returned bytes now return str (base64-encoded) to support the structured JSON response format.
  5. Updated API interfaces - All blob accessor methods (exif, image_blur, image_resize, image_normalize, pdf_extract, pdf_chunk) now accept the verbose parameter and handle the structured responses appropriately.
  6. Comprehensive test coverage - Added parametrized tests for both verbose modes across all blob functions.

Fixes #<403365429> 🦕

@shuoweil shuoweil requested review from a team and chelsea-lin August 25, 2025 22:43
@product-auto-label product-auto-label Bot added the size: xl Pull request size is extra large. label Aug 25, 2025
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Aug 25, 2025
@shuoweil shuoweil marked this pull request as draft August 25, 2025 22:44
@shuoweil shuoweil removed the request for review from chelsea-lin August 25, 2025 22:44
@shuoweil shuoweil assigned shuoweil and unassigned shobsi Aug 25, 2025
@shuoweil shuoweil force-pushed the shuowei-add-error-handling branch 2 times, most recently from 90e7d33 to cde2a61 Compare September 19, 2025 01:57
@shuoweil shuoweil force-pushed the shuowei-add-error-handling branch 2 times, most recently from 32fa87c to 623f9ba Compare October 10, 2025 03:36
@shuoweil shuoweil marked this pull request as ready for review October 10, 2025 03:37
@shuoweil shuoweil requested review from GarrettWu and sycai October 10, 2025 03:37
@shuoweil shuoweil force-pushed the shuowei-add-error-handling branch 2 times, most recently from 1a873bc to 75d69a7 Compare October 14, 2025 18:47
@shuoweil shuoweil force-pushed the shuowei-add-error-handling branch from 75d69a7 to 53528c7 Compare October 14, 2025 19:07
check_index_type=False,
engine="pillow", connection=bq_connection, verbose=verbose
)
if verbose:

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.

we usually don't put logics in unit tests: go/unit-testing-practices?polyglot=python#logic

In this case, we should use two test methods to avoid the "if-else" branch: test_blob_exif and text_blob_exif_verbose

The same suggestion applies to other test methods too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have modified all testcases as suggested. I also checked the failed testcase. They are unrelated to this change.

@shuoweil shuoweil requested a review from sycai October 15, 2025 17:17
@shuoweil shuoweil merged commit f9e28fe into main Oct 15, 2025
22 of 25 checks passed
@shuoweil shuoweil deleted the shuowei-add-error-handling branch October 15, 2025 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.