Skip to content

Feature/catalog-Add BigQuery and BigLake hierarchy UI#356

Open
aditee-accenture wants to merge 18 commits intoGoogleCloudDataproc:mainfrom
Shubha-accenture:feature/catalog-UI-hierarchy
Open

Feature/catalog-Add BigQuery and BigLake hierarchy UI#356
aditee-accenture wants to merge 18 commits intoGoogleCloudDataproc:mainfrom
Shubha-accenture:feature/catalog-UI-hierarchy

Conversation

@aditee-accenture
Copy link
Copy Markdown
Collaborator

This PR implements the functionality to navigate data hierarchies within a project.
It handles the top-level branching into BigQuery or BigLake, followed by their deeper nested structures.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 introduces a new 'Catalog' feature, providing a unified user interface for exploring and navigating data hierarchies across BigQuery and BigLake within a project. This enhancement streamlines data discovery by presenting a structured, tree-like view of datasets, tables, and columns, improving the overall user experience for interacting with various data sources.

Highlights

  • New Catalog UI: Introduced a new 'Catalog' user interface to provide a unified view for navigating data hierarchies within a project.
  • BigQuery and BigLake Integration: Implemented support for navigating data hierarchies specifically for BigQuery and BigLake, allowing users to explore projects, datasets, tables, and columns.
  • Codebase Refactoring and Reorganization: Refactored BigQuery-related components and services into a new 'catalog' directory structure, improving modularity and maintainability. This included renaming files and updating import paths across the application.
  • UI/UX Enhancements: Updated UI elements, icons, and styling to reflect the new Catalog feature, including new icons for BigLake and Catalog, and adjusted node depth calculations for tree interactions and context menus.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/bigQuery/bigQueryDatasetInfo.tsx
    • Renamed to src/catalog/common/bigQueryDatasetInfo.tsx
    • Updated CircularProgress class name for consistency
  • src/bigQuery/bigQueryDatasetInfoWrapper.tsx
    • Renamed to src/catalog/common/bigQueryDatasetInfoWrapper.tsx
    • Updated import path for DataprocWidget
    • Minor formatting adjustments
  • src/bigQuery/bigQuerySchema.tsx
    • Renamed to src/catalog/common/bigQuerySchema.tsx
    • Updated import path for handleDebounce
    • Corrected type casting for ReactNode in table header and cell rendering
  • src/bigQuery/bigQueryService.tsx
    • Renamed to src/catalog/bigquery/bigqueryWidgetService.tsx
    • Updated copyright year in header
    • Updated import paths for handler, const, and utils
    • Removed bigQueryPreviewAPIService, getBigQuerySchemaInfoAPIService, getBigQueryDatasetInfoAPIService, getBigQueryTableInfoAPIService, and getBigQueryDatasetDetailsAPIService methods, moving them to a new common service
    • Updated checkBigQueryDatasetsAPIService call to use BigQueryWidgetService
  • src/bigQuery/bigQueryTableInfo.tsx
    • Renamed to src/catalog/common/bigQueryTableInfo.tsx
    • Updated CircularProgress class name for consistency
  • src/bigQuery/bigQueryTableInfoWrapper.tsx
    • Renamed to src/catalog/common/bigQueryTableInfoWrapper.tsx
    • Updated import path for DataprocWidget
  • src/bigQuery/bigQueryWidget.tsx
    • Renamed to src/catalog/bigquery/bigQueryWidget.tsx
    • Updated import paths for various components and services
    • Added new LabIcon imports for BigLake and BigQuery
    • Modified IDataEntry interface to support optional properties and projectId
    • Updated tree structure logic to include BigQuery and BigLake nodes under projects
    • Adjusted depth calculations for node clicks and context menu visibility
    • Replaced BigQueryService calls with BigQueryWidgetService calls
    • Changed wrapper class name from 'dpms-Wrapper' to 'bigquery-widget-wrapper'
    • Updated title from 'Dataset Explorer' to 'Catalog'
    • Changed loader class name from 'database-loader' to 'catalog-loader'
    • Updated search field class name from 'search-field' to 'bigquery-search-field'
    • Changed tree class name from 'dataset-tree' to 'bigquery-tree'
    • Modified column type display to include parentheses and new styling
  • src/bigQuery/previewDataInfo.tsx
    • Renamed to src/catalog/common/previewDataInfo.tsx
    • Updated import paths for TableData, BigQueryService, handleDebounce, and PreviewPaginationView
  • src/catalog/common/bigQueryService.tsx
    • Added new file to centralize BigQuery API service calls
    • Included methods for bigQueryPreviewAPIService, getBigQuerySchemaInfoAPIService, getBigQueryDatasetInfoAPIService, getBigQueryTableInfoAPIService, getBigQueryDatasetDetailsAPIService, and checkBigQueryDatasetsAPIService
  • src/index.ts
    • Updated import path for BigQueryWidget to the new catalog directory
    • Changed 'datasetExplorerIcon' to 'catalogIcon' and updated its SVG source
    • Changed 'datasetExplorerIconDark' to 'catalogIconDark' and updated its SVG source
    • Renamed 'panelDatasetExplorer' variable to 'panelCatalog'
    • Updated panel ID from 'dataset-explorer-tab' to 'catalog-tab'
    • Changed panel title from 'Dataset Explorer - BigQuery' to 'Catalog'
    • Updated logging message from 'Bigquery dataset explorer is enabled' to 'Catalog is enabled'
  • style/catalog.css
    • Added new CSS file to define styles for the Catalog UI components
    • Included styles for bigquery-widget-wrapper, big-query-loader-style, big-query-schema-wrapper, catalog-title, bigquery-search-field, bigquery-tree, bigquery-column-type, and various loader/spinner styles
  • style/icons/biglake_icon.svg
    • Added new SVG icon for BigLake
  • style/icons/catalog_icon.svg
    • Added new SVG icon for the Catalog (light theme)
  • style/icons/catalog_icon_dark.svg
    • Added new SVG icon for the Catalog (dark theme)
  • style/index.css
    • Imported the new 'catalog.css' stylesheet
  • style/index.js
    • Imported the new 'catalog.css' stylesheet
  • ui-tests/tests/bigquery_dataset_explorer.spec.ts
    • Updated UI test selectors to reflect the new 'Catalog' tab name instead of 'Dataset Explorer - BigQuery'
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
Copy Markdown
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 introduces a significant UI enhancement by implementing a hierarchical view for BigQuery and BigLake resources within a new 'Catalog' explorer. The changes include a major refactoring, moving BigQuery-related components into a catalog directory and splitting services for better organization. The tree navigation logic has been updated to support the new nested structure (Project -> BigQuery/BigLake -> Dataset -> Table). While the implementation correctly reflects the new hierarchy, I've identified a couple of areas for improvement. The logic for retrieving parent data in the tree is fragile and could be made more robust. Additionally, there appears to be some placeholder code for the BigLake functionality that should be addressed.

const treeStructureforTables = () => {
let tempData = [...treeStructureData];
const datasetName = currentNode.data.name;
const projectName = currentNode.parent?.parent?.data?.name;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Accessing projectName via currentNode.parent?.parent?.data?.name is fragile and tightly couples the logic to the tree's depth. To improve this, you could propagate the projectId down to child nodes.

For instance, in treeStructureforDatasets, you could add projectId: projectData.name to each dataset node. Then, this line could be simplified to const projectName = currentNode.data.projectId;.

This would make the code more maintainable and less prone to breaking from UI structure changes. The same principle applies to treeStructureforSchema where an even longer chain (.parent.parent.parent) is used.

node.toggle();
} else if (depth === 2 && !node.isOpen) {
if (node.data.name === 'Biglake') {
console.log('hello biglake');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This console.log appears to be a placeholder for unimplemented functionality for 'Biglake' nodes. It should be replaced with the actual implementation or removed if this functionality is not yet ready.

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