Skip to content

Commit ad54373

Browse files
chrissieacodesminhazgemini-code-assist[bot]
authored
feat: python conversational analytics timestamp (#1733)
## 👋👋 Thank you for contributing to Looker sdk-codegen (⚡️🍣) - 👆 Make sure your pull request title follows [Pull Request Title Guidelines](https://github.com/looker-open-source/sdk-codegen/blob/main/CONTRIBUTING.md#title-guidelines) from our [Contribution guide](https://github.com/looker-open-source/sdk-codegen/blob/main//CONTRIBUTING.md) - 👉 Don't forget to replace these instructions with your _✨awesome✨_ description of what this change _actually does_. Additionally, it's great to include context on how it works and why the change was needed. - 👇 Edit "Developer Checklist" to reflect items relevant to this PR (and try to make sure to check everything off before asking for review) ## Developer Checklist [ℹ️](https://github.com/looker-open-source/sdk-codegen/blob/main/CONTRIBUTING.md#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: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/looker-open-source/sdk-codegen/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕 --------- Co-authored-by: Minhaz Kazi <vlookup@google.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent ac92db1 commit ad54373

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

‎python/tests/integration/test_methods.py‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from looker_sdk.sdk.api40 import methods as mtds
1212
from looker_sdk.sdk.api40 import models as ml
13+
from looker_sdk import error
1314

1415

1516
@pytest.fixture(scope="module")
@@ -687,20 +688,25 @@ def test_conversational_analytics(sdk: mtds.Looker40SDK):
687688
try:
688689
# 1. Create a temporary Agent
689690
print("\nCreating temporary test agent...")
690-
agent = sdk.create_agent(
691-
body=ml.WriteAgent(
692-
name="Temp SDK Test Agent",
693-
category="conversation",
694-
description="Temporary agent created for SDK integration tests",
695-
sources=[ml.Source(model="thelook",explore="products")]
691+
try:
692+
agent = sdk.create_agent(
693+
body=ml.WriteAgent(
694+
name="Temp SDK Test Agent",
695+
category="conversation",
696+
description="Temporary agent created for SDK integration tests",
697+
sources=[ml.Source(model="thelook",explore="products")]
698+
)
696699
)
697-
)
700+
except error.SDKError as e:
701+
if "not found" in e.message.lower() or "unsupported" in e.message.lower():
702+
pytest.skip(f"Conversational Analytics (Agents) is not enabled on this Looker instance: {e.message}")
703+
raise
698704
assert isinstance(agent, ml.Agent)
699705
assert isinstance(agent.id, str)
700706
agent_id = agent.id
701707
print(f"✅ Created agent: {agent_id}")
702708

703-
# 2. Create a Conversation for this agent
709+
# 2. Create a Conversation for this agent
704710
print("Creating conversation...")
705711
conv = sdk.create_conversation(
706712
body=ml.WriteConversation(

0 commit comments

Comments
 (0)