Skip to content

Conversation

shikharbsar
Copy link
Collaborator

No description provided.

Copy link

Summary of Changes

Hello @shikharbsar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the display logic for data sources by introducing a new filtering criterion. The primary goal is to ensure that only data sources explicitly enabled for AI answer generation (spotter) are presented to the user, irrespective of their specific type. This modification enhances the accuracy and relevance of available data sources for AI-driven functionalities and is fully supported by updated unit tests that validate the new filtering behavior.

Highlights

  • Updated Data Source Filtering Logic: The core filtering mechanism for data sources has been revised in thoughtspot-service.ts. Previously, it relied on the type or subType being 'WORKSHEET'. Now, it filters data sources based on whether aiAnswerGenerationDisabled is explicitly false.
  • Expanded Data Source Eligibility: This change broadens the definition of what constitutes a valid data source. Data sources beyond just 'WORKSHEET' types (e.g., 'LOGICAL_TABLE' as demonstrated in tests) can now be included if their aiAnswerGenerationDisabled property is false, aligning with the comment that 'Tables can also be used for spotter now'.
  • Comprehensive Test Coverage: Associated test files (mcp-server.spec.ts and thoughtspot-service.spec.ts) have been updated to incorporate the new aiAnswerGenerationDisabled property. This ensures thorough validation of the new filtering behavior across various data source types and configurations, including cases where AI answer generation is both enabled and disabled.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mnk-blr
Copy link

mnk-blr commented Sep 24, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the data source filtering logic to exclude sources where AI answer generation is disabled. The implementation is mostly correct, but I've suggested a more robust filtering condition to handle cases where the aiAnswerGenerationDisabled property might be missing from the API response. Additionally, I've pointed out a misleading comment in the test suite that should be corrected for clarity.

.filter(d => d.metadata_header.type === "WORKSHEET" || d.metadata_header.subType === "WORKSHEET")
// Tables can also be used for spotter now
//.filter(d => d.metadata_header.type === "WORKSHEET" || d.metadata_header.subType === "WORKSHEET")
.filter(d => d.metadata_header.aiAnswerGenerationDisabled === false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current filter d.metadata_header.aiAnswerGenerationDisabled === false will exclude datasources where aiAnswerGenerationDisabled is undefined or null. If the absence of this property implies that AI answer generation is enabled, this filter is too strict and might hide datasources that should be visible.

A more robust approach would be to check for explicit disablement, like so: d.metadata_header.aiAnswerGenerationDisabled !== true. This ensures that only datasources explicitly marked as disabled are filtered out, while those with false, null, or undefined values are correctly included.

To ensure this behavior is covered, you could also add a test case in test/thoughtspot/thoughtspot-service.spec.ts for a datasource where aiAnswerGenerationDisabled is missing.

Suggested change
.filter(d => d.metadata_header.aiAnswerGenerationDisabled === false)
.filter(d => d.metadata_header.aiAnswerGenerationDisabled !== true)

},
{
metadata_header: {
type: 'LOGICAL_TABLE', // This should be filtered out due to aiAnswerGenerationDisabled: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This comment is misleading. It states that this data source should be filtered out, but aiAnswerGenerationDisabled is false, and this data source (lt2) is correctly included in the test's expected results. The comment appears to be a copy-paste error from the object above. Please correct or remove it to avoid confusion.

Suggested change
type: 'LOGICAL_TABLE', // This should be filtered out due to aiAnswerGenerationDisabled: true
type: 'LOGICAL_TABLE', // This is included because aiAnswerGenerationDisabled is false

@shikharbsar shikharbsar merged commit 09b2b24 into main Sep 24, 2025
3 of 4 checks passed
@shikharbsar shikharbsar deleted the ds_spotter_disabled branch September 24, 2025 16:23
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.

3 participants