Skip to content

Conversation

vermaAstra
Copy link
Contributor

Description

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:

  • Follow the CONTRIBUTING Guide.
  • You are listed as the author in your notebook or README file.
  • Your account is listed in CODEOWNERS for the file(s).
  • Ensure the tests and linter pass (Run nox -s format from the repository root to format).

Fixes #<issue_number_goes_here> 🦕

vermaAstra and others added 30 commits July 12, 2025 00:14
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Your branch is up to date with 'origin/main'.
#
# Changes to be committed:
#	renamed:    agents/geminidataanalytics/colabs/geminidataanalytics_public_http_demo_|_vPublished.ipynb -> agents/gemini_data_analytics/intro_gemini_data_analytics_http.ipynb
#	renamed:    agents/geminidataanalytics/colabs/geminidataanalytics_public_SDK_demo_|_vPublished.ipynb -> agents/gemini_data_analytics/intro_gemini_data_analytics_sdk.ipynb
#
@vermaAstra vermaAstra requested a review from a team as a code owner September 26, 2025 15:35
Copy link
Contributor

Summary of Changes

Hello @vermaAstra, 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 significantly upgrades the Gemini Data Analytics notebooks by enabling the configuration and querying of multiple Looker explores simultaneously. This enhancement allows for more comprehensive and flexible data analysis directly within the notebooks, streamlining the process of interacting with diverse Looker datasets through a single data agent.

Highlights

  • Multi-Explore Support for Looker Datasource: The primary enhancement is the introduction of multi-explore support for Looker datasources in the Gemini Data Analytics notebooks. Users can now configure and query across multiple Looker explores within a single data agent.
  • Notebook Refactoring and Readability: Both intro_gemini_data_analytics_http.ipynb and intro_gemini_data_analytics_sdk.ipynb have undergone refactoring. This includes reordering import statements, improving variable naming for Looker configurations, and enhancing code readability and robustness, particularly in handling protobuf messages in the SDK notebook.
  • Dynamic Datasource Selection: A new datasource_references variable has been introduced in the HTTP notebook, allowing for dynamic selection between BigQuery, Looker, or Looker Studio data sources when creating a data agent, offering greater flexibility.
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.

Copy link
Contributor

@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 successfully adds support for multiple Looker explores as datasources, enhancing the functionality of both the HTTP and SDK notebooks. The changes are consistent and well-implemented. My review includes a few minor suggestions for improving code style and readability, as well as a medium-severity comment on a potential issue in the SDK notebook related to how conversation history is managed. Overall, this is a solid contribution.

" show_message(response)\n",
" if response.system_message or response.user_message:\n",
" conversation_messages.append(response)"
" conversation_messages.append(response)"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Removing the if response.system_message or response.user_message: check could introduce a bug. If the stream contains messages that are not meant to be part of the conversation history (e.g., progress updates, empty messages), appending them to conversation_messages could corrupt the history for subsequent multi-turn requests. It would be safer to retain the check to ensure only valid conversational messages are stored.

        if response.system_message or response.user_message:
            conversation_messages.append(response)

"# # \"lookml_model\": lookml_model_2,\n",
"# # \"explore\": explore_2,\n",
"# # },\n",
"#. # Add up to 5 total explore references here\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

There appears to be a typo in this comment. Please remove the leading . character.

Suggested change
"#. # Add up to 5 total explore references here\n",
#. # Add up to 5 total explore references here

" try:\n",
" json_object = json_lib.loads(str)\n",
" except ValueError:\n",
" except ValueError as e:\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

The caught exception e is not used. It's a good practice to omit the variable to signal that it's intentionally unused, which also avoids potential linter warnings.

    except ValueError:

" data_json = json_lib.loads(acc)\n",
"\n",
" if \"systemMessage\" not in data_json:\n",
" if not \"systemMessage\" in data_json:\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

For better readability and adherence to Python style conventions (PEP 8), it's recommended to use if 'key' not in a_dict: instead of if not 'key' in a_dict:.

            if "systemMessage" not in data_json:

" conversation_messages.append(data_json)\n",
"\n",
" if \"systemMessage\" not in data_json:\n",
" if not \"systemMessage\" in data_json:\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

low

For better readability and adherence to Python style conventions (PEP 8), it's recommended to use if 'key' not in a_dict: instead of if not 'key' in a_dict:.

            if "systemMessage" not in data_json:

Copy link
Collaborator

@holtskinner holtskinner left a comment

Choose a reason for hiding this comment

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

Not sure why this happened, but it seems like a bunch of the HTML tags got URL Encoded when they don't need to be. Can you undo those changes?

@vermaAstra
Copy link
Contributor Author

Thanks for pointing out this. Corrected.

@holtskinner holtskinner merged commit 59e265c into GoogleCloudPlatform:main Sep 29, 2025
5 checks passed
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