Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Expose diagnostic as a quick pick command #1173

Merged
merged 4 commits into from
May 31, 2024

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented May 30, 2024

Description

This pull request introduces a new feature to the DbtPowerUserControlCenterAction by adding a "Diagnostics" option to the quick pick commands. This new option allows users to easily run diagnostics on their dbt project directly from the quick pick menu, enhancing the tool's usability and accessibility for troubleshooting and analysis.

Summary

  • Added a new DbtPowerUserControlPanelItem for "Diagnostics" in the puQuickPick.ts file.
  • This new command is accessible through the quick pick menu, providing a straightforward way for users to initiate diagnostics on their dbt project.
  • The command is identified by "dbtPowerUser.diagnostics" and is accompanied by a descriptive label and an icon for easy recognition.
  • This enhancement streamlines the process of running diagnostics, making it more efficient and user-friendly.

Fixes #1168.


💡 To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

This is an automated message generated by Sweep AI.

@sweep-ai sweep-ai bot added the sweep label May 30, 2024
@anandgupta42 anandgupta42 self-requested a review May 30, 2024 02:16
@anandgupta42
Copy link
Contributor

anandgupta42 commented May 30, 2024

Sweep:
When I click on the diagnostics button for the first time some of the output is getting clipped and is not shown in the terminal output. However, on second run the entire output is visible.

First run output

02:04:52  Running with dbt=1.6.9
02:04:52  dbt version: 1.6.9
02:04:52  python version: 3.8.15
02:04:52  python path: /Users/anandgupta/miniforge3/envs/testaltimate/bin/python
02:04:52  os info: macOS-14.4.1-arm64-arm-64bit
02:04:52  Using profiles dir at /Users/anandgupta/.dbt
02:04:52  Using profiles.yml file at /Users/anandgupta/.dbt/profiles.yml
02:04:52  Using dbt_project.yml file at /Users/anandgupta/codebase/jaffle_shop-altimate/dbt_project.yml
02:04:52  adapter type: snowflake
02:04:52  adapter version: 1.6.0
02:04:52  Configuration:
02:04:52    profiles.yml file [OK found and valid]
02:04:52    dbt_project.yml file [OK found and valid]
02:04:52  Required dependencies:
02:04:52   - git [OK found]
02:04:52  Connection:
02:04:52    account: ejjkbko-fub20041
02:04:52    user: juleszobi
02:04:52    database: analytics
02:04:52    warehouse: COMPUTE_WH
02:04:52    role: ACCOUNTADMIN
02:04:52    schema: jaffle_shop
02:04:52    authenticator: None
02:04:52    private_key: None
02:04:52    private_key_path: None
02:04:52    private_key_passphrase: None
02:04:52    token: None
02:04:52    oauth_client_id: None
02:04:52    query_tag: None
02:04:52    client_session_keep_alive: False
02:04:52    host: None
02:04:52    port: None
02:04:52    proxy_host: None
02:04:52    proxy_port: None
02:04:52    protocol: None
02:04:52    connect_retries: 1
02:04:52    connect_timeout: None
02:04:52    retry_on_database_errors: False
02:04:52    retry_all: False
02:04:52    insecure_mode: False
02:04:52    reuse_connections: None
02:04:52  Registered adapter: snowflake=1.6.0
02:04:53    Connection test: [OK connection ok]
02:04:53  All checks passed!
--------------------------------------------------------------------------

Diagnostics completed successfully...

Diagnostics started...


Printing environment variables...

  • Please remove any sensitive information before sending it to us

COLORFGBG=7;0
COLORTERM=truecolor
COMMAND_MODE=unix2003
VSCODE_L10N_BUNDLE_LOCATION=


Printing extension settings...

  • Please remove any sensitive information before sending it to us

enableNewLineagePanel=true enableNewLineagePanel is overridden in workspace settings
altimateAiKey=XXXX altimateAiKey is overridden in user settings
altimateInstanceName=XXXX altimateInstanceName is overridden in user settings
altimateAiKey=XXXXX altimateAiKey is overridden in user settings
altimateInstanceName=XXXX altimateInstanceName is overridden in user settings
enableNewLineagePanel=true enableNewLineagePanel is overridden in workspace settings
enableCollaboration=true
enableNewQueryPanel=false enableNewQueryPanel is overridden in workspace settings
lineage={"showSelectEdges":true,"showNonSelectEdges":true,"defaultExpansion":1}
unquotedCaseInsensitiveIdentifierRegex=
dbtIntegration=core
dbtPythonPathOverride=
dbtCustomRunnerImport=from dbt.cli.main import dbtRunner
allowListFolders=[]
runModelCommandAdditionalParams=[]
buildModelCommandAdditionalParams=[]
queryLimit=500
conversationsPollingInterval=120
queryTemplate=select * from ({query}
) as query limit {limit}
queryScale=1
fileNameTemplateGenerateModel={prefix}{sourceName}{tableName}
prefixGenerateModel=base
sqlFmtPath=
sqlFmtAdditionalParams=[]
deferConfigPerProject={}
queryLimit=500
enableNewDocsPanel=true enableNewDocsPanel is overridden in workspace settings
enableNewQueryPanel=false enableNewQueryPanel is overridden in workspace settings
enableNewLineagePanel=true enableNewLineagePanel is overridden in workspace settings
profilesDirOverride=. profilesDirOverride is overridden in workspace settings
dbtIntegration=core


Python Path=/Users/anandgupta/miniforge3/envs/testaltimate/bin/python
VSCode version=1.89.1
Extension version=0.39.12
DBT integration mode=core
First workspace path=/Users/anandgupta/codebase/jaffle_shop-altimate

Python is installed
DBT is installed
Number of projects=1


Printing information for jaffle_shop

Project Name=jaffle_shop
Adapter Type=snowflake
DBT version=1.6.9
Python bridge is connected

DBT Project File path=/Users/anandgupta/codebase/jaffle_shop-altimate/dbt_project.yml File exists at location
Target path=/Users/anandgupta/codebase/jaffle_shop-altimate/target File exists at location
PackageInstall path=XXXX/codebase/jaffle_shop-altimate/dbt_packages File exists at location
Manifest path=XXXX/codebase/jaffle_shop-altimate/target/manifest.json File exists at location
Catalog path=XXXX/codebase/jaffle_shop-altimate/target/catalog.json File doesn't exists at location
Model path=XXXX/codebase/jaffle_shop-altimate/models File exists at location
Seed path=XXXX/jaffle_shop-altimate/seeds File exists at location
Macro path=XXXX/codebase/jaffle_shop-altimate/macros File doesn't exists at location

dbt_project.yml

name: "jaffle_shop"

config-version: 2
version: "0.1"

profile: "jaffle_shop"

model-paths: ["models"]
seed-paths: ["seeds"]
test-paths: ["tests"]
analysis-paths: ["analysis"]
macro-paths: ["macros"]

target-path: "target"
clean-targets:

  • "target"
  • "dbt_modules"
  • "logs"

require-dbt-version: [">=1.0.0", "<2.0.0"]

models:
jaffle_shop:
materialized: table
staging:
materialized: view

dbt-cloud:
project-id: 333398


Number of diagnostics issues=0

Executing task: dbt debug --project-dir XXXX --profiles-dir /Users/anandgupta/.dbt
02:05:14 Running with dbt=1.6.9
02:05:14 dbt version: 1.6.9
02:05:14 python version: 3.8.15
02:05:14 python path: XXXX
02:05:14 os info: macOS-14.4.1-arm64-arm-64bit
02:05:14 Using profiles dir at XXXX
02:05:14 Using profiles.yml file at XXXX
02:05:14 Using dbt_project.yml file at XXXX
02:05:14 adapter type: snowflake
02:05:14 adapter version: 1.6.0
02:05:14 Configuration:
02:05:14 profiles.yml file [OK found and valid]
02:05:14 dbt_project.yml file [OK found and valid]
02:05:14 Required dependencies:
02:05:14 - git [OK found]
02:05:14 Connection:
02:05:14 account: XXXX
02:05:14 user: XXXXX
02:05:14 database: XXXX
02:05:14 warehouse: XXXXX
02:05:14 role: XXXX
02:05:14 schema: jaffle_shop
02:05:14 authenticator: None
02:05:14 private_key: None
02:05:14 private_key_path: None
02:05:14 private_key_passphrase: None
02:05:14 token: None
02:05:14 oauth_client_id: None
02:05:14 query_tag: None
02:05:14 client_session_keep_alive: False
02:05:14 host: None
02:05:14 port: None
02:05:14 proxy_host: None
02:05:14 proxy_port: None
02:05:14 protocol: None
02:05:14 connect_retries: 1
02:05:14 connect_timeout: None
02:05:14 retry_on_database_errors: False
02:05:14 retry_all: False
02:05:14 insecure_mode: False
02:05:14 reuse_connections: None
02:05:14 Registered adapter: snowflake=1.6.0
02:05:15 Connection test: [OK connection ok]
02:05:15 All checks passed!


Diagnostics completed successfully...
Second run output


Copy link
Contributor

@anandgupta42 anandgupta42 left a comment

Choose a reason for hiding this comment

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

When I click on the diagnostics button for the first time some of the output is getting clipped and is not shown in the terminal output. However, on second run the entire output is visible.

First run output

02:04:52  Running with dbt=1.6.9
02:04:52  dbt version: 1.6.9
02:04:52  python version: 3.8.15
02:04:52  python path: /Users/anandgupta/miniforge3/envs/testaltimate/bin/python
02:04:52  os info: macOS-14.4.1-arm64-arm-64bit
02:04:52  Using profiles dir at /Users/anandgupta/.dbt
02:04:52  Using profiles.yml file at /Users/anandgupta/.dbt/profiles.yml
02:04:52  Using dbt_project.yml file at /Users/anandgupta/codebase/jaffle_shop-altimate/dbt_project.yml
02:04:52  adapter type: snowflake
02:04:52  adapter version: 1.6.0
02:04:52  Configuration:
02:04:52    profiles.yml file [OK found and valid]
02:04:52    dbt_project.yml file [OK found and valid]
02:04:52  Required dependencies:
02:04:52   - git [OK found]
02:04:52  Connection:
02:04:52    account: ejjkbko-fub20041
02:04:52    user: juleszobi
02:04:52    database: analytics
02:04:52    warehouse: COMPUTE_WH
02:04:52    role: ACCOUNTADMIN
02:04:52    schema: jaffle_shop
02:04:52    authenticator: None
02:04:52    private_key: None
02:04:52    private_key_path: None
02:04:52    private_key_passphrase: None
02:04:52    token: None
02:04:52    oauth_client_id: None
02:04:52    query_tag: None
02:04:52    client_session_keep_alive: False
02:04:52    host: None
02:04:52    port: None
02:04:52    proxy_host: None
02:04:52    proxy_port: None
02:04:52    protocol: None
02:04:52    connect_retries: 1
02:04:52    connect_timeout: None
02:04:52    retry_on_database_errors: False
02:04:52    retry_all: False
02:04:52    insecure_mode: False
02:04:52    reuse_connections: None
02:04:52  Registered adapter: snowflake=1.6.0
02:04:53    Connection test: [OK connection ok]
02:04:53  All checks passed!
--------------------------------------------------------------------------

Diagnostics completed successfully...

Diagnostics started...


Printing environment variables...

  • Please remove any sensitive information before sending it to us

COLORFGBG=7;0
COLORTERM=truecolor
COMMAND_MODE=unix2003
VSCODE_L10N_BUNDLE_LOCATION=


Printing extension settings...

  • Please remove any sensitive information before sending it to us

enableNewLineagePanel=true enableNewLineagePanel is overridden in workspace settings
altimateAiKey=XXXX altimateAiKey is overridden in user settings
altimateInstanceName=XXXX altimateInstanceName is overridden in user settings
altimateAiKey=XXXXX altimateAiKey is overridden in user settings
altimateInstanceName=XXXX altimateInstanceName is overridden in user settings
enableNewLineagePanel=true enableNewLineagePanel is overridden in workspace settings
enableCollaboration=true
enableNewQueryPanel=false enableNewQueryPanel is overridden in workspace settings
lineage={"showSelectEdges":true,"showNonSelectEdges":true,"defaultExpansion":1}
unquotedCaseInsensitiveIdentifierRegex=
dbtIntegration=core
dbtPythonPathOverride=
dbtCustomRunnerImport=from dbt.cli.main import dbtRunner
allowListFolders=[]
runModelCommandAdditionalParams=[]
buildModelCommandAdditionalParams=[]
queryLimit=500
conversationsPollingInterval=120
queryTemplate=select * from ({query}
) as query limit {limit}
queryScale=1
fileNameTemplateGenerateModel={prefix}{sourceName}{tableName}
prefixGenerateModel=base
sqlFmtPath=
sqlFmtAdditionalParams=[]
deferConfigPerProject={}
queryLimit=500
enableNewDocsPanel=true enableNewDocsPanel is overridden in workspace settings
enableNewQueryPanel=false enableNewQueryPanel is overridden in workspace settings
enableNewLineagePanel=true enableNewLineagePanel is overridden in workspace settings
profilesDirOverride=. profilesDirOverride is overridden in workspace settings
dbtIntegration=core


Python Path=/Users/anandgupta/miniforge3/envs/testaltimate/bin/python
VSCode version=1.89.1
Extension version=0.39.12
DBT integration mode=core
First workspace path=/Users/anandgupta/codebase/jaffle_shop-altimate

Python is installed
DBT is installed
Number of projects=1


Printing information for jaffle_shop

Project Name=jaffle_shop
Adapter Type=snowflake
DBT version=1.6.9
Python bridge is connected

DBT Project File path=/Users/anandgupta/codebase/jaffle_shop-altimate/dbt_project.yml File exists at location
Target path=/Users/anandgupta/codebase/jaffle_shop-altimate/target File exists at location
PackageInstall path=XXXX/codebase/jaffle_shop-altimate/dbt_packages File exists at location
Manifest path=XXXX/codebase/jaffle_shop-altimate/target/manifest.json File exists at location
Catalog path=XXXX/codebase/jaffle_shop-altimate/target/catalog.json File doesn't exists at location
Model path=XXXX/codebase/jaffle_shop-altimate/models File exists at location
Seed path=XXXX/jaffle_shop-altimate/seeds File exists at location
Macro path=XXXX/codebase/jaffle_shop-altimate/macros File doesn't exists at location

dbt_project.yml

name: "jaffle_shop"

config-version: 2
version: "0.1"

profile: "jaffle_shop"

model-paths: ["models"]
seed-paths: ["seeds"]
test-paths: ["tests"]
analysis-paths: ["analysis"]
macro-paths: ["macros"]

target-path: "target"
clean-targets:

  • "target"
  • "dbt_modules"
  • "logs"

require-dbt-version: [">=1.0.0", "<2.0.0"]

models:
jaffle_shop:
materialized: table
staging:
materialized: view

dbt-cloud:
project-id: 333398


Number of diagnostics issues=0

Executing task: dbt debug --project-dir XXXX --profiles-dir /Users/anandgupta/.dbt
02:05:14 Running with dbt=1.6.9
02:05:14 dbt version: 1.6.9
02:05:14 python version: 3.8.15
02:05:14 python path: XXXX
02:05:14 os info: macOS-14.4.1-arm64-arm-64bit
02:05:14 Using profiles dir at XXXX
02:05:14 Using profiles.yml file at XXXX
02:05:14 Using dbt_project.yml file at XXXX
02:05:14 adapter type: snowflake
02:05:14 adapter version: 1.6.0
02:05:14 Configuration:
02:05:14 profiles.yml file [OK found and valid]
02:05:14 dbt_project.yml file [OK found and valid]
02:05:14 Required dependencies:
02:05:14 - git [OK found]
02:05:14 Connection:
02:05:14 account: XXXX
02:05:14 user: XXXXX
02:05:14 database: XXXX
02:05:14 warehouse: XXXXX
02:05:14 role: XXXX
02:05:14 schema: jaffle_shop
02:05:14 authenticator: None
02:05:14 private_key: None
02:05:14 private_key_path: None
02:05:14 private_key_passphrase: None
02:05:14 token: None
02:05:14 oauth_client_id: None
02:05:14 query_tag: None
02:05:14 client_session_keep_alive: False
02:05:14 host: None
02:05:14 port: None
02:05:14 proxy_host: None
02:05:14 proxy_port: None
02:05:14 protocol: None
02:05:14 connect_retries: 1
02:05:14 connect_timeout: None
02:05:14 retry_on_database_errors: False
02:05:14 retry_all: False
02:05:14 insecure_mode: False
02:05:14 reuse_connections: None
02:05:14 Registered adapter: snowflake=1.6.0
02:05:15 Connection test: [OK connection ok]
02:05:15 All checks passed!


Diagnostics completed successfully...
Second run output


@anandgupta42 anandgupta42 changed the base branch from main to master May 30, 2024 15:58
Copy link
Contributor Author

sweep-ai bot commented May 30, 2024

Sweep: PR Review

Authors of pull request: @anandgupta42, @sweep-ai[bot]

This pull request introduced a new diagnostic feature to the dbt Power User Control Center.

A new DbtPowerUserControlPanelItem was added to the dbtpuquickpick.items array in src/quickpick/puQuickPick.ts. This item is labeled "Diagnostics" and uses the "tools" icon. Its description is "Run diagnostics on the dbt project," and it is associated with the command dbtPowerUser.diagnostics.

This addition allows users to run diagnostics on their dbt project directly from the QuickPick menu, enhancing the tool's functionality and providing a more comprehensive user experience.


Sweep Found These Issues

src/quickpick/puQuickPick.ts
  • The new "Diagnostics" item does not have any validation to ensure the dbtPowerUser.diagnostics command exists, which could lead to runtime errors if the command is not registered.
  • "Diagnostics",
    "tools",
    "Run diagnostics on the dbt project",
    "dbtPowerUser.diagnostics",

    View Diff


Copy link
Contributor Author

sweep-ai bot commented May 31, 2024

❌ Failed to make changes:

The exception message is:'Repository' object has no attribute 'repo'

The stack trace is:Traceback (most recent call last):
File "/app/sweepai/handlers/on_comment.py", line 350, in on_comment
commit = commit_multi_file_changes(cloned_repo.repo, new_file_contents_to_commit, commit_message, branch_name)
File "/app/sweepai/utils/github_utils.py", line 233, in commit_multi_file_changes
repo = cloned_repo.repo
AttributeError: 'Repository' object has no attribute 'repo'

Please report this on our community forum.

This is an automated message generated by Sweep AI.

@anandgupta42 anandgupta42 merged commit 1411db8 into master May 31, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose diagnostic as a quick pick command
1 participant