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

feat: project governance llm checks #45

Merged
merged 13 commits into from
Dec 30, 2024
Merged

Conversation

gaurpulkit
Copy link
Contributor

@gaurpulkit gaurpulkit commented Nov 15, 2024

Important

Adds project governance LLM checks to APIClient, integrates them into project-health CLI command, and updates DBTInsightGenerator to include these checks in reports.

  • Behavior:
    • Adds get_project_governance_llm_checks() and run_project_governance_llm_checks() to APIClient in client.py for governance checks.
    • Integrates LLM checks into project_health() in cli.py, displaying results in CLI.
  • CLI:
    • Adds --token, --instance-name, and --backend-url options to project-health command in cli.py.
    • Displays LLM check results with detailed insights in project-health command.
  • Utils:
    • Adds utility functions get_project_governance_llm_checks() and run_project_governance_llm_checks() in utils.py for API interaction.
  • Constants:
    • Adds LLM constant to constants.py for categorizing LLM insights.
  • Executor:
    • Updates DBTInsightGenerator in executor.py to run LLM checks and include results in reports.

This description was created by Ellipsis for a499fee. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to c18defa in 1 minute and 0 seconds

More details
  • Looked at 119 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. src/datapilot/clients/altimate/client.py:99
  • Draft comment:
    Ensure exception handling is in place for the post method call to handle potential request failures gracefully.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. src/datapilot/clients/altimate/client.py:95
  • Draft comment:
    Ensure exception handling is in place for the get method call to handle potential request failures gracefully.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_BCGDTdFZfdaawF23


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 54ba983 in 11 seconds

More details
  • Looked at 147 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/cli/cli.py:104
  • Draft comment:
    Unnecessary use of len to check if llm_insights is non-empty. Use if llm_insights: instead.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in project_health function checks the length of llm_insights using len(llm_insights), which is unnecessary since if llm_insights: is sufficient to check if the list is non-empty.

Workflow ID: wflow_1JJEKRij4FdXXCJS


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 26380e3 in 28 seconds

More details
  • Looked at 36 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/executor.py:100
  • Draft comment:
    get_project_governance_llm_checks and run_project_governance_llm_checks should be imported from datapilot.clients.altimate.client instead of datapilot.clients.altimate.utils.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is not about a change made in the diff. The diff only shows changes to the arguments passed to run_project_governance_llm_checks, not where the functions are imported from. The comment does not provide strong evidence that the import source is incorrect or needs to be changed. It seems speculative without additional context.
    I might be missing context about why the import source should be changed. The comment could be based on a broader understanding of the codebase that isn't visible in the diff.
    Without evidence in the diff or a clear explanation, the comment does not meet the criteria for being kept. It seems speculative and unrelated to the changes made.
    Delete the comment as it is not about a change made in the diff and lacks strong evidence for its suggestion.

Workflow ID: wflow_u1jlGKwNPFXpITaM


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on ae7423c in 21 seconds

More details
  • Looked at 18 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/cli/cli.py:111
  • Draft comment:
    Ensure that the keys 'path', 'reason_to_flag', and 'recommendation' exist in the 'answer' dictionary. If the data structure has changed, this could lead to KeyError exceptions.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The changes in the PR involve updating the keys used in the click.echo statements. It's important to ensure that these keys match the structure of the data being processed.

Workflow ID: wflow_u2GP6tRWMXuJnzPC


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on bf82ad6 in 31 seconds

More details
  • Looked at 102 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_4pupLVqcpB0S3lpl


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

metadata = answer.get("metadata", {})
metadata["source"] = LLM
metadata["llm_id"] = report["id"]
metadata["catagory"] = report["type"]
Copy link

Choose a reason for hiding this comment

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

Typo in metadata key: catagory should be category. This could lead to issues when accessing this metadata.

Suggested change
metadata["catagory"] = report["type"]
metadata["category"] = report["type"]

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 94d5563 in 23 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/executor.py:190
  • Draft comment:
    Typo in variable name. Consider renaming catagory to category for consistency.
                        metadata["category"] = report["type"]
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_GBwx0JJSpiUE9nBG


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 71dce56 in 11 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/executor.py:189
  • Draft comment:
    Ensure that the change from llm_id to teammate_check_id is consistent across the codebase. If llm_id is used elsewhere, it should be updated to teammate_check_id for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The change from llm_id to teammate_check_id seems intentional and aligns with the context of the code, but it's important to ensure consistency across the codebase.

Workflow ID: wflow_B0y4GQZnmXKYPQE1


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on c636504 in 13 seconds

More details
  • Looked at 40 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/executor.py:111
  • Draft comment:
    Ensure self.manifest and self.catalog have a json() method before calling it, or handle the case where they might not have this method to avoid potential errors.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_CAxnuGLPP3l0LOnH


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 603be25 in 12 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/cli/cli.py:30
  • Draft comment:
    Avoid setting default values in both the @click.option decorator and the function parameters. Set the default value in one place to prevent redundancy and potential maintenance issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The project_health function has a potential issue with the default value of backend_url. The default value is set both in the @click.option decorator and in the function parameter list. This redundancy can lead to maintenance issues and should be avoided.

Workflow ID: wflow_JmHsetzfiG63XeFs


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on de31c42 in 14 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/executor.py:212
  • Draft comment:
    Use answer.get("package_name", "") to simplify the conditional expression.
package_name=answer.get("package_name", ""),
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code uses a conditional expression to handle a missing key in a dictionary. This is a good practice to avoid KeyError, but it can be simplified using the dict.get() method.

Workflow ID: wflow_3iCWQ0ZZ51Wgee3Z


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 0cff308 in 31 seconds

More details
  • Looked at 17 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_KBE6NZSCMcyX5IT8


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

severity=answer["severity"],
path=answer["path"] if answer.get("path") else "",
original_file_path=answer["original_file_path"] if answer.get("original_file_path") else "",
package_name=answer.get["package_name"] if answer.get("package_name") else "",
Copy link

Choose a reason for hiding this comment

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

Incorrect syntax for accessing dictionary values. Use parentheses for the get method.

Suggested change
package_name=answer.get["package_name"] if answer.get("package_name") else "",
package_name=answer.get("package_name") if answer.get("package_name") else "",

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on dfd43ea in 20 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/datapilot/core/platforms/dbt/executor.py:191
  • Draft comment:
    Incorrect syntax for accessing dictionary values. Use answer.get("package_name") instead of answer.get["package_name"]. This issue also appears on lines 210 and 211.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_e853KmPR3umDCvUL


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on a499fee in 28 seconds

More details
  • Looked at 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_VFHxXlYl9MD35lcE


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

severity=answer["severity"],
path=answer["path"] if answer.get("path") else "",
original_file_path=answer["original_file_path"] if answer.get("original_file_path") else "",
package_name=answer["package_name"] if answer.get("package_name") else "",
Copy link

Choose a reason for hiding this comment

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

Incorrect syntax for accessing dictionary values. Use answer.get("package_name") instead of answer.get["package_name"].

@suryaiyer95 suryaiyer95 requested a review from mdesmet December 27, 2024 03:40
Copy link
Collaborator

@suryaiyer95 suryaiyer95 left a comment

Choose a reason for hiding this comment

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

Looks okay, @mdesmet Please have a look as well

@suryaiyer95
Copy link
Collaborator

@gaurpulkit Some tests are failing, Please have a look

@mdesmet
Copy link
Collaborator

mdesmet commented Dec 30, 2024

@gaurpulkit : The checks are failing, can you PTAL?

Copy link
Collaborator

@mdesmet mdesmet left a comment

Choose a reason for hiding this comment

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

LGTM except 3.8 compatiblilty

@mdesmet
Copy link
Collaborator

mdesmet commented Dec 30, 2024

Also is following scenario property handled:

The user has a config that has LLM checks but forgets to provide the api key and tenant?

@mdesmet mdesmet merged commit af23595 into main Dec 30, 2024
90 of 102 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.

5 participants