fix: suppress FutureWarning from google.api_core that corrupts sync action JSON (SUPPORT-16198)#3
Closed
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Closed
Conversation
…ction JSON (SUPPORT-16198) The google.api_core library emits a FutureWarning about Python 3.10 deprecation. This warning is routed through the logging system to stdout, which corrupts the JSON payload returned by sync actions like list_queries (load existing report IDs). Changes: - Add warnings.filterwarnings before Google imports to suppress the FutureWarning - Add try/except in list_queries and list_report_dimensions sync actions to convert unexpected exceptions into UserException for proper error reporting - Add per-file E402 ignore in flake8.cfg for the early warnings import Co-Authored-By: olena.marchuk <olena.marchuk@keboola.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
When primary_key_existing is None (not configured or sync action failed to load dimensions), translate_filters(None) crashes with 'NoneType object is not iterable'. Default to empty list. Co-Authored-By: olena.marchuk <olena.marchuk@keboola.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs causing the DV360 component to fail (SUPPORT-16198):
Bug 1: Sync action "Load available reports" returns invalid JSON
The
google.api_corelibrary emits aFutureWarningabout Python 3.10 deprecation. This warning is routed through the logging system to stdout, corrupting the JSON payload returned by sync actions likelist_queries. The runner then fails with "Decoding JSON response from component failed: Syntax error".Fix:
warnings.filterwarnings("ignore", ...)placed before Google imports, plus try/except in sync actions to convert unexpected errors intoUserException.Bug 2: Job crash with
'NoneType' object is not iterableWhen
primary_key_existingisNone(not configured, or sync action for loading dimensions was broken),translate_filters(None)crashes. Confirmed via Datadog logs for job 165977385.Fix: Guard with
pks_raw or []before passing totranslate_filters.Review & Testing Checklist for Human
Notes
google/api_core/_python_version_support.pygoogle-api-core)Release Notes
Justification, description
Fix sync actions (load existing report IDs, load report dimensions) failing with "Decoding JSON response from component failed: Syntax error" caused by a FutureWarning from google.api_core polluting stdout. Also fix job crash when primary_key_existing is None.
Plans for Customer Communication
N/A - transparent fix, no user-facing changes needed.
Impact Analysis
Low risk. Only adds a warning filter, wraps existing sync action logic in try/except, and adds a None guard. No changes to data processing or report execution logic.
Deployment Plan
Standard tag release and Developer Portal update.
Rollback Plan
Revert to previous tag if needed.
Post-Release Support Plan
N/A
Link to Devin session: https://app.devin.ai/sessions/e4d0a3cad28c412a98459a32c0c7e24e