Skip to content

Conversation

@sundarshankar89
Copy link
Collaborator

@sundarshankar89 sundarshankar89 commented Jun 3, 2025

Changes

What does this PR do?

This introduces the intial version of CLI

Relevant implementation details

Caveats/things to watch out for when reviewing:

Linked issues

~ ❯ databricks labs lakebridge execute-database-profiler --help                                                                                                                                                 26s
Profile the source system database

Usage:
  databricks labs lakebridge execute-database-profiler [flags]

Flags:
  -h, --help                 help for execute-database-profiler
      --source-tech string   (Optional) The technology/platform of the sources to Profile

Global Flags:
      --debug            enable debug logging
  -o, --output type      output type: text or json (default text)
  -p, --profile string   ~/.databrickscfg profile
  -t, --target string    bundle target to use (if applicable)
~ ❯ databricks labs lakebridge execute-database-profiler --source-tech mssql
12:24:59    ERROR [d.labs.lakebridge] Only following source system is supported ['synapse']
12:24:59    ERROR [d.l.lakebridge.execute-database-profiler] ValueError: Invalid source technology mssql


~ ❯ databricks labs lakebridge execute-database-profiler --source-tech Synapse
[UPGRADE ADVISED] Newer lakebridge version was released 12 days ago. Please run `databricks labs upgrade lakebridge` to upgrade: feature/profiler_entry_point -> v0.10.11
12:25:15    ERROR [d.l.lakebridge.execute-database-profiler] ValueError: Connection details not found. Please run `databricks labs lakebridge configure-database-profiler` to set up connection details for synapse.
~
~ ❯ databricks labs lakebridge execute-database-profiler
Select the source technology
[0] synapse
Enter a number between 0 and 0: 0
12:32:50    ERROR [d.l.lakebridge.execute-database-profiler] ValueError: Connection details not found. Please run `databricks labs lakebridge configure-database-profiler` to set up connection details for synapse.

Functionality

  • added relevant user documentation
  • added new CLI command
  • modified existing command: databricks labs remorph ...
  • ... +add your own

Tests

  • manually tested
  • added unit tests
  • added integration tests

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@gueniai gueniai left a comment

Choose a reason for hiding this comment

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

We should also add the command to deploy the profiler dashboard

- name: execute-database-profiler
description: Profile the source system database
flags:
- name: source-tech
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the advantage of having this as optional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can prompt if it is not passed in CLI for interactive operations.

def _execute(self, platform: str, config_path: str, extractor=None):
try:
config_full_path = self._locate_config(config_path)
config = Profiler.path_modifier(config_full_path)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will adjust this, make pathmodifier as class method

- name: execute-database-profiler
description: Profile the source system database
flags:
- name: source-tech
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can prompt if it is not passed in CLI for interactive operations.

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 24.24242% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.81%. Comparing base (7be6421) to head (37029bb).

Files with missing lines Patch % Lines
src/databricks/labs/lakebridge/cli.py 21.87% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1623      +/-   ##
==========================================
+ Coverage   64.87%   65.81%   +0.93%     
==========================================
  Files          96       96              
  Lines        7895     7921      +26     
  Branches      821      824       +3     
==========================================
+ Hits         5122     5213      +91     
+ Misses       2593     2528      -65     
  Partials      180      180              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"""Deploys a profiler summary as a Databricks dashboard."""
ctx = ApplicationContext(w)
ctx.add_user_agent_extra("cmd", "create-profiler-dashboard")
ctx.dashboard_manager.create_profiler_summary_dashboard(extract_file, source_tech, catalog_name, schema_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Dependent upon the dashboard_manager Class introduced in PR#2000.

Copy link
Collaborator Author

@sundarshankar89 sundarshankar89 Oct 28, 2025

Choose a reason for hiding this comment

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

@goodwillpunning we need this branch working so I m removing this for now, you stack the changes on top of this PR as stacked PR

Copy link
Collaborator

@gueniai gueniai left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat/cli actions that are visible to the user feat/profiler Issues related to profilers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants