Skip to content

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
devin/1777622863-fix-futurewarning-stdout
Closed

fix: suppress FutureWarning from google.api_core that corrupts sync action JSON (SUPPORT-16198)#3
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1777622863-fix-futurewarning-stdout

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 1, 2026

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_core library emits a FutureWarning about Python 3.10 deprecation. This warning is routed through the logging system to stdout, corrupting the JSON payload returned by sync actions like list_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 into UserException.

Bug 2: Job crash with 'NoneType' object is not iterable

When primary_key_existing is None (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 to translate_filters.

Review & Testing Checklist for Human

  • Test the "Load available reports" button in the DV360 configuration UI (existing report ID mode) to confirm reports load successfully
  • Run a job with an existing report ID that has no primary keys configured — should complete without crash
  • Verify a full run of the component still works end-to-end with an existing report
  • Consider upgrading the base Docker image from Python 3.10 to 3.13 in a follow-up to eliminate the warning at source

Notes

  • Confirmed via Datadog that ALL error-level logs for this component in the past 7 days are the FutureWarning from google/api_core/_python_version_support.py
  • The FutureWarning is generated by an unpinned transitive dependency (google-api-core)
  • Long-term fix should upgrade Python and pin/update Google dependencies

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

…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>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants