Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
e61dd3e
pipeline extension
sundarshankar89 Mar 21, 2025
bfa8490
Init commit
sundarshankar89 Mar 24, 2025
65bd96f
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Apr 1, 2025
e578178
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Apr 2, 2025
73b36c2
Merge branch 'main' into feature/pipeline_extensions
sundarshankar89 Apr 3, 2025
8e95927
Init commit
sundarshankar89 Mar 24, 2025
cabf93a
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 Apr 3, 2025
ec33f67
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 Apr 3, 2025
440cc70
Merge branch 'main' into feature/pipeline_extensions
sundarshankar89 Apr 9, 2025
d6fcabb
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 Apr 10, 2025
2988569
fmt fixes
sundarshankar89 Apr 10, 2025
f0c87d6
fmt fixes
sundarshankar89 Apr 10, 2025
0764e01
refactor
sundarshankar89 Apr 10, 2025
d188705
Added tests for dependency
sundarshankar89 Apr 14, 2025
68b0f83
Added tests for dependency
sundarshankar89 Apr 14, 2025
5bd9408
Added Failure tests
sundarshankar89 Apr 14, 2025
5899a3c
installer as venv
sundarshankar89 Apr 15, 2025
3cdbf7e
fmt fixes
sundarshankar89 Apr 15, 2025
822da6b
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 Apr 15, 2025
299d293
fmt fixes
sundarshankar89 Apr 15, 2025
9186b89
Added Python Script
sundarshankar89 Apr 16, 2025
18f9b42
Added Python Script
sundarshankar89 Apr 16, 2025
877a239
Fmt fixes
sundarshankar89 Apr 17, 2025
492a12f
Merge branch 'main' into feature/pipeline_extensions
sundarshankar89 Apr 22, 2025
d0ca03f
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 Apr 22, 2025
603aa0f
intermediate commit
sundarshankar89 Apr 29, 2025
204c639
init commit
sundarshankar89 Apr 29, 2025
1af4de9
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 Apr 29, 2025
75fbfb5
Merge branch 'main' into feature/pipeline_extensions
sundarshankar89 Apr 29, 2025
de87a2a
fmt fixes
sundarshankar89 Apr 29, 2025
3288543
fix tests
sundarshankar89 Apr 29, 2025
2768763
fixed silent bug during insall
sundarshankar89 Apr 30, 2025
b5bf390
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 Apr 30, 2025
1d9673f
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 Apr 30, 2025
fb66dd3
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 Apr 30, 2025
be954be
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 5, 2025
92f3d68
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 6, 2025
aea2178
addressed review comments
sundarshankar89 May 6, 2025
0d6a047
Merge remote-tracking branch 'origin/feature/pipeline_extensions' int…
sundarshankar89 May 6, 2025
c528807
fixed test
sundarshankar89 May 7, 2025
eabdf29
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 May 7, 2025
9308475
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 May 7, 2025
c1a5913
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 7, 2025
79100e4
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 7, 2025
35aa15d
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 May 7, 2025
7458e3b
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 May 7, 2025
f4c63b9
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 7, 2025
8912f1f
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 7, 2025
af3ffdc
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 10, 2025
b192d10
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 10, 2025
8e6bffa
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 May 10, 2025
f053e7d
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 May 10, 2025
ab4ae41
intermediate
sundarshankar89 May 12, 2025
b3a4cdd
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 12, 2025
02a0a56
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 12, 2025
cc5aea8
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 May 12, 2025
f58c9c9
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 May 12, 2025
d54589b
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 13, 2025
72ebe58
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 13, 2025
699d317
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 May 13, 2025
bdb0052
Merge remote-tracking branch 'origin/feature/synapse_data_collector' …
sundarshankar89 May 13, 2025
8bf4023
fixed workspace_extract.py
sundarshankar89 May 20, 2025
7ea7a3c
intermediate commit
sundarshankar89 May 20, 2025
4782c14
intermediate commit
sundarshankar89 May 21, 2025
37caa5f
intermediate commit
sundarshankar89 May 21, 2025
e91a6d9
intermediate commit
sundarshankar89 May 21, 2025
37e3b6e
intermediate commit
sundarshankar89 May 21, 2025
a74cf51
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 28, 2025
a0324c5
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 28, 2025
0e7af90
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 May 28, 2025
2af79ca
Merge branch 'main' into feature/synapse-cred-configuration
sundarshankar89 May 30, 2025
8665b3e
Merge branch 'feature/synapse-cred-configuration' into feature/pipeli…
sundarshankar89 May 30, 2025
849f67e
Merge branch 'feature/pipeline_extensions' into feature/synapse_data_…
sundarshankar89 May 30, 2025
e541c22
fmt fixes
sundarshankar89 May 30, 2025
f642683
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Jun 3, 2025
05d20e3
fmt fixes
sundarshankar89 Jun 3, 2025
40fc5ec
fix test
sundarshankar89 Jun 3, 2025
e153a91
Initial commit with entry point
sundarshankar89 Jun 3, 2025
dab0fbf
fmt fixes
sundarshankar89 Jun 3, 2025
ba305ba
fmt fixes
sundarshankar89 Jun 3, 2025
76d2e1f
using DEVNULL for dependency installer
sundarshankar89 Jun 3, 2025
ef09e51
logger and fmt fixes
sundarshankar89 Jun 3, 2025
414574f
logger and fmt fixes
sundarshankar89 Jun 3, 2025
0dbe824
added driver
sundarshankar89 Jun 4, 2025
480a590
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jun 4, 2025
d90cc7b
synapse extract
sundarshankar89 Jun 4, 2025
b23ad5f
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jun 4, 2025
1fbd1b2
synapse extract
sundarshankar89 Jun 4, 2025
1359234
synapse extract
sundarshankar89 Jun 4, 2025
ebce184
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jun 4, 2025
094e442
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Jun 7, 2025
1991d8f
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jun 7, 2025
01f7850
Merge remote-tracking branch 'origin/main' into feature/synapse_data_…
sundarshankar89 Jun 8, 2025
7900fba
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jun 8, 2025
c0e7bf8
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Jul 18, 2025
9bd424f
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jul 18, 2025
a4c9491
intermediate format fixes
sundarshankar89 Jul 18, 2025
5e2709b
intermediate format fixes
sundarshankar89 Jul 18, 2025
c43fd7f
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jul 18, 2025
3c76d7f
fmt fixes
sundarshankar89 Jul 18, 2025
e271bc3
fmt fixes
sundarshankar89 Jul 18, 2025
570384b
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jul 18, 2025
dff71af
fmt fixes
sundarshankar89 Jul 18, 2025
6508981
Update pyproject.toml
sundarshankar89 Jul 21, 2025
f5216c5
Merge branch 'main' into chore/fmt-fixes
sundarshankar89 Jul 21, 2025
4951a22
fmt fixes
sundarshankar89 Jul 21, 2025
c0b98ae
Merge branch 'chore/fmt-fixes' into feature/synapse_data_collector
sundarshankar89 Jul 21, 2025
08503d9
fmt fixes
sundarshankar89 Jul 21, 2025
dfa0e85
save db
sundarshankar89 Jul 21, 2025
9151f69
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jul 21, 2025
a2f5289
review comments
sundarshankar89 Jul 21, 2025
bbc9775
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Jul 22, 2025
81ce857
merge main
sundarshankar89 Jul 22, 2025
e44af22
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jul 22, 2025
1d0375c
Fixes review comments
sundarshankar89 Jul 22, 2025
1bf1106
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Jul 28, 2025
ffdb9a8
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jul 28, 2025
b00ff9e
fixing review comments
sundarshankar89 Jul 29, 2025
b5120b3
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Jul 29, 2025
5682bfe
Modifed Dedicated Pool Extraction
sundarshankar89 Jul 30, 2025
3e874d8
fixed failing tests
sundarshankar89 Jul 30, 2025
a7f585c
Modified Serverless Extract
sundarshankar89 Aug 4, 2025
741eb63
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Aug 4, 2025
228ed24
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Aug 4, 2025
dec2b71
Fixes failing tests
sundarshankar89 Aug 4, 2025
37fd059
fix review comments
sundarshankar89 Aug 4, 2025
01b0868
merge changes
sundarshankar89 Aug 4, 2025
dfc2d87
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Aug 4, 2025
3cc3c83
fixed review comments
sundarshankar89 Aug 4, 2025
d7ee063
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Aug 4, 2025
562e3a6
modified file names
sundarshankar89 Aug 5, 2025
29cdca6
modified table names
sundarshankar89 Aug 5, 2025
b3f531b
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Aug 5, 2025
0130766
fixes logging
sundarshankar89 Aug 5, 2025
89f908e
fixed logging
sundarshankar89 Aug 5, 2025
bc9239d
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Aug 5, 2025
d38abfc
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Aug 5, 2025
2678720
refactored the code
sundarshankar89 Aug 6, 2025
9219f0f
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Aug 6, 2025
d0960b7
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Aug 6, 2025
d7c9196
fixed failing tests
sundarshankar89 Aug 6, 2025
10077f3
fixed review comments
sundarshankar89 Aug 6, 2025
67545d6
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Aug 7, 2025
c36bb95
ammended windows support
sundarshankar89 Aug 11, 2025
5f13f0f
amended windows support
sundarshankar89 Aug 11, 2025
46dcee6
amended windows support
sundarshankar89 Aug 11, 2025
153f224
amended windows support
sundarshankar89 Aug 11, 2025
7cf7c5c
amended windows support
sundarshankar89 Aug 11, 2025
b969785
amended windows support
sundarshankar89 Aug 11, 2025
7b0acd5
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Aug 11, 2025
8f4405c
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Aug 11, 2025
8a745dc
amended windows support
sundarshankar89 Aug 11, 2025
400b586
amended windows support
sundarshankar89 Aug 11, 2025
bfe2c37
amended windows support
sundarshankar89 Aug 11, 2025
33a42c8
added additional logs and handled empty list
sundarshankar89 Aug 18, 2025
abbe23b
added additional logs and handled empty list
sundarshankar89 Aug 18, 2025
34b6d9b
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Sep 2, 2025
c095e8f
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Sep 2, 2025
9e56b8e
Initial Commit of configure assessment
sundarshankar89 Sep 2, 2025
a230739
Fixed unnecessary exclude lists
sundarshankar89 Sep 2, 2025
be9b358
Merged UX Recommendation
sundarshankar89 Sep 2, 2025
dcf8ee9
Added more comments
sundarshankar89 Sep 2, 2025
3dedb84
updated to use passowrd prompt for terminal echo off
sundarshankar89 Sep 3, 2025
ee2a99e
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Sep 3, 2025
a045625
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Sep 3, 2025
aeb2e00
Merge branch 'main' into feature/configure-assessment
sundarshankar89 Sep 3, 2025
6c0a539
updated to use auth_type and add additional key string during authent…
sundarshankar89 Sep 3, 2025
028fadf
fix the string compare "ad_passwd_authentication"
sundarshankar89 Sep 3, 2025
18ff36c
Merge branch 'main' into feature/configure-assessment
gueniai Sep 3, 2025
177e69b
updated to reflect main
sundarshankar89 Sep 8, 2025
26fc1ed
Merge branch 'main' into feature/configure-assessment
sundarshankar89 Sep 8, 2025
eee4c24
Updated with custom gen ai
sundarshankar89 Sep 8, 2025
ffc33aa
Merge branch 'main' into feature/configure-assessment
sundarshankar89 Sep 8, 2025
9853440
Merge branch 'main' into feature/synapse_data_collector
sundarshankar89 Sep 15, 2025
4c386bd
Merge branch 'feature/synapse_data_collector' into feature/profiler_e…
sundarshankar89 Sep 15, 2025
ac77f81
Merge branch 'main' into feature/configure-assessment
sundarshankar89 Sep 15, 2025
f916a99
fmt fixes
sundarshankar89 Sep 15, 2025
afd8272
Scripts for Synapse Profiling re-imagined from existing profiler
sundarshankar89 Sep 15, 2025
75c5b5b
Introduced Profiler Skeleton
sundarshankar89 Sep 15, 2025
8a631ed
Merge branch 'feature/configure-assessment' into feature/add_profiler…
sundarshankar89 Sep 15, 2025
26fd78a
Addressed review comments
sundarshankar89 Sep 29, 2025
11e38d3
Merge branch 'main' into feature/configure-assessment
sundarshankar89 Sep 29, 2025
e1e23f2
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Sep 29, 2025
baef44e
Merge branch 'feature/configure-assessment' into feature/add_profiler…
sundarshankar89 Sep 29, 2025
9111c31
Addressed review comments
sundarshankar89 Sep 29, 2025
6d0de29
Merge branch 'main' into feature/configure-assessment
sundarshankar89 Oct 6, 2025
a604e0b
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Oct 6, 2025
ec2c1e4
Merge branch 'feature/configure-assessment' into feature/add_profiler…
sundarshankar89 Oct 6, 2025
599cbf5
fixed review comment
sundarshankar89 Oct 6, 2025
baf0eb3
fmt fixes
sundarshankar89 Oct 6, 2025
da0c85c
update pyproject.toml
sundarshankar89 Oct 6, 2025
e8f59a4
bump blueprint
sundarshankar89 Oct 6, 2025
b8a6c70
bump blueprint and fmt fixes
sundarshankar89 Oct 6, 2025
ae841e7
addressing review comments
sundarshankar89 Oct 6, 2025
354a461
Merge branch 'bump/blueprint-0.11.4' into feature/configure-assessment
sundarshankar89 Oct 6, 2025
d56958c
Merge branch 'feature/configure-assessment' into feature/add_profiler…
sundarshankar89 Oct 6, 2025
9925b44
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Oct 6, 2025
d305754
Merge branch 'main' into feature/add_profiler_skeleton
sundarshankar89 Oct 7, 2025
eac40a3
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Oct 7, 2025
c79c01a
fixing review comments
sundarshankar89 Oct 7, 2025
2195df6
fixing review comments-2
sundarshankar89 Oct 7, 2025
ccba2df
fixing review comments-3
sundarshankar89 Oct 7, 2025
9a9e909
fixing review comments-3
sundarshankar89 Oct 7, 2025
635b84a
fixed failing tests
sundarshankar89 Oct 7, 2025
c23cb0e
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Oct 7, 2025
53b3fa9
Merge branch 'main' into feature/add_profiler_skeleton
sundarshankar89 Oct 7, 2025
be777f6
Merge branch 'feature/synapse_profiler_scripts' into feature/add_prof…
sundarshankar89 Oct 7, 2025
4763885
fix a typo
sundarshankar89 Oct 7, 2025
6f8997c
Merge branch 'feature/synapse_profiler_scripts' into feature/add_prof…
sundarshankar89 Oct 7, 2025
4992e6b
added close connection
sundarshankar89 Oct 7, 2025
1a5288f
Merge branch 'feature/synapse_profiler_scripts' into feature/add_prof…
sundarshankar89 Oct 7, 2025
9df6d0b
fixes review comments
sundarshankar89 Oct 8, 2025
9e55fe8
fixes review comments
sundarshankar89 Oct 8, 2025
393dbe9
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Oct 9, 2025
11da6d9
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Oct 9, 2025
3dc6f88
added context manager
sundarshankar89 Oct 9, 2025
6085fca
Merge branch 'feature/synapse_profiler_scripts' into feature/add_prof…
sundarshankar89 Oct 9, 2025
cb38bf5
added connection close
sundarshankar89 Oct 9, 2025
13417bf
Merge branch 'feature/synapse_profiler_scripts' into feature/add_prof…
sundarshankar89 Oct 9, 2025
53429c4
Merge branch 'main' into feature/synapse_profiler_scripts
sundarshankar89 Oct 10, 2025
b660e4a
addressed merge conflicts
sundarshankar89 Oct 10, 2025
3dd7455
Merge branch 'feature/synapse_profiler_scripts' into feature/add_prof…
sundarshankar89 Oct 10, 2025
5dbb664
removed print
sundarshankar89 Oct 10, 2025
b262013
Merge branch 'feature/synapse_profiler_scripts' into feature/add_prof…
sundarshankar89 Oct 10, 2025
6f547d2
Merge branch 'feature/add_profiler_skeleton' into feature/profiler_en…
sundarshankar89 Oct 13, 2025
fc076cd
fmt fixes
sundarshankar89 Oct 13, 2025
fe50a8b
Merge branch 'main' into feature/profiler_entry_point
sundarshankar89 Oct 14, 2025
a08f4ab
added telemetry
sundarshankar89 Oct 14, 2025
3fb3165
made source-tech optional param
sundarshankar89 Oct 16, 2025
773cbba
made source-tech optional param
sundarshankar89 Oct 16, 2025
5643750
made source-tech optional param
sundarshankar89 Oct 16, 2025
1c40b90
made source-tech optional param
sundarshankar89 Oct 16, 2025
451caf2
made source-tech optional param
sundarshankar89 Oct 16, 2025
77cc4a7
Fixed Copilot review comments
sundarshankar89 Oct 16, 2025
e2c0819
Fixed Copilot review comments
sundarshankar89 Oct 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions labs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ commands:

- name: configure-reconcile
description: Configure 'reconcile' dependencies

- name: execute-database-profiler
description: Profile the source system database
flags:
- name: source-tech
description: (Optional) The technology/platform of the sources to Profile
2 changes: 1 addition & 1 deletion src/databricks/labs/lakebridge/assessments/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

# TODO modify this PLATFORM_TO_SOURCE_TECHNOLOGY.keys() once all platforms are supported
PROFILER_SOURCE_SYSTEM = ["mssql", "synapse"]
PROFILER_SOURCE_SYSTEM = ["synapse"]


# This flag indicates whether a connector is required for the source system when pipeline is trigger
Expand Down
55 changes: 44 additions & 11 deletions src/databricks/labs/lakebridge/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@


from databricks.labs.lakebridge.assessments.configure_assessment import create_assessment_configurator
from databricks.labs.lakebridge.assessments import PROFILER_SOURCE_SYSTEM
from databricks.labs.lakebridge.assessments import PROFILER_SOURCE_SYSTEM, PRODUCT_NAME
from databricks.labs.lakebridge.assessments.profiler import Profiler

from databricks.labs.lakebridge.config import TranspileConfig, LSPConfigOptionV1
from databricks.labs.lakebridge.contexts.application import ApplicationContext
from databricks.labs.lakebridge.connections.credential_manager import cred_file
from databricks.labs.lakebridge.helpers.recon_config_utils import ReconConfigPrompts
from databricks.labs.lakebridge.helpers.telemetry_utils import make_alphanum_or_semver
from databricks.labs.lakebridge.install import installer
Expand Down Expand Up @@ -686,18 +688,19 @@ def configure_secrets(*, w: WorkspaceClient) -> None:
recon_conf.prompt_and_save_connection_details()


@lakebridge.command(is_unauthenticated=True)
def configure_database_profiler() -> None:
"""[Experimental] Install the lakebridge Assessment package"""
prompts = Prompts()

# Prompt for source system
source_system = str(
prompts.choice("Please select the source system you want to configure", PROFILER_SOURCE_SYSTEM)
).lower()
@lakebridge.command
def configure_database_profiler(w: WorkspaceClient) -> None:
"""[Experimental] Installs and runs the Lakebridge Assessment package for database profiling"""
ctx = ApplicationContext(w)
ctx.add_user_agent_extra("cmd", "configure-profiler")
prompts = ctx.prompts
source_tech = prompts.choice("Select the source technology", PROFILER_SOURCE_SYSTEM).lower()
ctx.add_user_agent_extra("profiler_source_tech", make_alphanum_or_semver(source_tech))
user = ctx.current_user
logger.debug(f"User: {user}")

# Create appropriate assessment configurator
assessment = create_assessment_configurator(source_system=source_system, product_name="lakebridge", prompts=prompts)
assessment = create_assessment_configurator(source_system=source_tech, product_name="lakebridge", prompts=prompts)
assessment.run()


Expand Down Expand Up @@ -795,6 +798,36 @@ def analyze(
logger.debug(f"User: {ctx.current_user}")


@lakebridge.command()
def execute_database_profiler(w: WorkspaceClient, source_tech: str | None = None) -> None:
"""Execute the Profiler Extraction for the given source technology"""
ctx = ApplicationContext(w)
ctx.add_user_agent_extra("cmd", "execute-profiler")
prompts = ctx.prompts
if source_tech is None:
source_tech = prompts.choice("Select the source technology", PROFILER_SOURCE_SYSTEM)
source_tech = source_tech.lower()

if source_tech not in PROFILER_SOURCE_SYSTEM:
logger.error(f"Only the following source systems are supported: {PROFILER_SOURCE_SYSTEM}")
raise_validation_exception(f"Invalid source technology {source_tech}")

ctx.add_user_agent_extra("profiler_source_tech", make_alphanum_or_semver(source_tech))
user = ctx.current_user
logger.debug(f"User: {user}")
# check if cred_file is present which has the connection details before running the profiler
file = cred_file(PRODUCT_NAME)
if not file.exists():
raise_validation_exception(
f"Connection details not found. Please run `databricks labs lakebridge configure-database-profiler` "
f"to set up connection details for {source_tech}."
)
profiler = Profiler.create(source_tech)

# TODO: Add extractor logic to ApplicationContext instead of creating inside the Profiler class
profiler.profile()


if __name__ == "__main__":
lakebridge()
if is_in_debug():
Expand Down
Loading