Skip to content

adding thumbs up, thumbs down, comments and review request for GenieAPI in the SDK#1002

Closed
pavel-chowdhury-maersk wants to merge 7 commits into
databricks:mainfrom
pavel-chowdhury-maersk:feature_feedback_to_genie
Closed

adding thumbs up, thumbs down, comments and review request for GenieAPI in the SDK#1002
pavel-chowdhury-maersk wants to merge 7 commits into
databricks:mainfrom
pavel-chowdhury-maersk:feature_feedback_to_genie

Conversation

@pavel-chowdhury-maersk

@pavel-chowdhury-maersk pavel-chowdhury-maersk commented Jul 9, 2025

Copy link
Copy Markdown

What changes are proposed in this pull request?

WHAT: This PR adds Genie API functionality to the Databricks SDK, specifically implementing support for feedback and review features that come out of the box with Genie. The changes include:

  • Update GenieAPI class to enable interaction with Databricks Genie feedback and review mechanism
  • Implemented feedback submission methods (submit_message_feedback) supporting both thumbs up/down ratings
  • Added comment submission functionality (submit_comment) for collaborative review
  • Integrated message review request updates (update_message_review_request)
  • Included FeedbackRating enum for standardized feedback ratings

WHY: At Maersk, we are integrating Genie with Microsoft Teams to leverage all the built-in features for feedback and review workflows. The existing Databricks SDK lacked direct support for Genie's collaborative features, which are essential for our MS Teams-based analytics and review processes. This integration enables programmatic interaction with Genie feedback and review system, allowing us to build automated feedback collection and review workflows.

Feedback Requested

I would greatly appreciate feedback on this PR to ensure it adheres to Databricks contribution guidelines and standards. As this is my first contribution to the Databricks SDK, I want to make sure the implementation follows:

  • Databricks SDK design patterns and conventions
  • Proper error handling and validation approaches
  • Appropriate testing methodologies and coverage
  • Code style and documentation standards
  • API design consistency with existing SDK patterns

Any suggestions for improvements or alignment with established practices would be very valuable.

How is this tested?

The Genie API integration has been tested using the following code snippet in a live Genie space:

from databricks.sdk.service.dashboards import FeedbackRating
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.dashboards import GenieAPI

# Initialize workspace client with your credentials
workspace_client = WorkspaceClient(
    host="https://your-workspace.azuredatabricks.net",  # Replace with your workspace URL
    token="your-access-token-here",  # Replace with your personal access token
    auth_type="pat"
)

genie_api = GenieAPI(workspace_client.api_client)

# Submit thumbs up feedback
response = genie_api.submit_message_feedback(
    space_id="your-space-id-here",  # Replace with your Genie space ID
    conversation_id="your-conversation-id-here",  # Replace with conversation ID
    message_id="your-message-id-here",  # Replace with message ID
    feedback_rating=FeedbackRating.THUMBS_UP
)

# Submit thumbs down feedback with categories
response = genie_api.submit_message_feedback(
    space_id="your-space-id-here",
    conversation_id="your-conversation-id-here", 
    message_id="your-message-id-here",
    feedback_rating=FeedbackRating.THUMBS_DOWN,
    feedback_categories=[]
)

# Submit a comment with custom content
response = genie_api.submit_comment(
    space_id="your-space-id-here",
    conversation_id="your-conversation-id-here",
    message_id="your-message-id-here",
    content="Test comment from SDK integration",
    comment_type="REQUEST_COMMENT"
)

# Update the message for request review
response = genie_api.update_message_review_request(
    space_id="your-space-id-here",
    conversation_id="your-conversation-id-here",
    message_id="your-message-id-here"
)
print(response)

Testing Status: Tested locally against live Genie space with successful feedback submission, comment creation, and review request updates. All API endpoints responded correctly and the feedback/comments appeared in the Genie interface as expected.

Note for Testing: To test this integration, replace the placeholder values (your-workspace.azuredatabricks.net, your-access-token-here, your-space-id-here, etc.) with actual values from your Databricks workspace and Genie space.

@github-actions

Copy link
Copy Markdown

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 1002
  • Commit SHA: fee0e0b2504ee9ba1e28b9b0bf05e13f3abbe191

Checks will be approved automatically on success.

@hectorcast-db

Copy link
Copy Markdown
Contributor

Hi @pavel-chowdhury-maersk

Thanks for reaching out.

Unfortunately, we cannot accept this PR. Our SDKs are automatically generated based on the configuration provided by different teams. This means that even if we merge this, the change will be undone automatically the next time we release the SDK.

We will be redirecting the request to add this method to the appropriate team.

I will close this PR since it cannot be merged, but feel free to ask follow-up questions if any.

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.

2 participants