modified tests for integration#1732
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the test_conversational_analytics integration test to gracefully handle cases where Conversational Analytics is not enabled by catching error.SDKError and skipping the test. However, the error module is not imported in the test file, which will cause a NameError if an exception is thrown. An inline import of error from looker_sdk is recommended to resolve this issue.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| try: | ||
| agent = sdk.create_agent( | ||
| body=ml.WriteAgent( | ||
| name="Temp SDK Test Agent", | ||
| category="conversation", | ||
| description="Temporary agent created for SDK integration tests", | ||
| sources=[ml.Source(model="thelook",explore="products")] | ||
| ) | ||
| ) | ||
| ) | ||
| except error.SDKError as e: |
There was a problem hiding this comment.
The error module is not imported in this test file, which will cause a NameError when attempting to catch error.SDKError if an exception is raised. To resolve this, we can import error from looker_sdk inline within the try block so it is available when the except clause is evaluated.
try:
from looker_sdk import error
agent = sdk.create_agent(
body=ml.WriteAgent(
name="Temp SDK Test Agent",
category="conversation",
description="Temporary agent created for SDK integration tests",
sources=[ml.Source(model="thelook",explore="products")]
)
)
except error.SDKError as e:
Python Tests 7 files - 1 7 suites - 1 24s ⏱️ -19s For more details on these failures, see this check. Results for commit 2a0c4ce. ± Comparison against base commit ac92db1. |
👋👋 Thank you for contributing to Looker sdk-codegen (⚡️🍣)
Developer Checklist ℹ️
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕