-
Notifications
You must be signed in to change notification settings - Fork 103
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
Remove deprecated apis #1417
base: master
Are you sure you want to change the base?
Remove deprecated apis #1417
Conversation
WalkthroughThe changes involve commenting out various functionalities related to Python path management and version checking across multiple files. Specifically, logging of Python paths has been disabled, error handling for Python interpreter compatibility has been simplified by removing checks for Python 3, and properties related to Python environment management have been removed from the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DBTClient
participant PythonEnvironment
User->>DBTClient: Request operation
DBTClient->>PythonEnvironment: Check Python version (removed)
PythonEnvironment-->>DBTClient: (no response)
DBTClient->>User: Continue operation without version check
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 8eab166 in 19 seconds
More details
- Looked at
97
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. src/dbt_client/index.ts:115
- Draft comment:
The commented-out code for checking Python 3 should be removed if it's no longer needed. Keeping commented-out code can clutter the codebase and make it harder to maintain. This applies to similar comments in other files as well. - Reason this comment was not posted:
Marked as duplicate.
2. src/manifest/pythonEnvironment.ts:122
- Draft comment:
The commented-out code for getting all Python paths and checking Python version should be removed if it's no longer needed. Keeping commented-out code can clutter the codebase and make it harder to maintain. This applies to similar comments in other files as well. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_sUYPW5IC42HFQJmE
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.
@@ -418,14 +418,14 @@ export class VSCodeCommands implements Disposable { | |||
this.dbtTerminal.logNewLine(); | |||
|
|||
// Printing env vars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented-out code for logging Python paths should be removed if it's no longer needed. Keeping commented-out code can clutter the codebase and make it harder to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/commands/index.ts (1 hunks)
- src/dbt_client/index.ts (1 hunks)
- src/manifest/pythonEnvironment.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- src/commands/index.ts
Additional comments not posted (4)
src/manifest/pythonEnvironment.ts (4)
20-20
: LGTM!Removing the unused
allPythonPaths
property is a good cleanup and improves code maintainability.
123-124
: LGTM!Removing the code for retrieving the Python execution path is a good cleanup and improves code maintainability.
122-126
: Verify the impact of removing Python path management and version detection.Removing the code for Python path management and version detection simplifies the
PythonEnvironment
class and aligns with the shift in focus towardsdbtTerminal
.Please ensure that the removal of this functionality does not introduce any issues in other parts of the codebase that might rely on it.
Run the following script to verify the usage of the removed properties and methods:
Verification successful
Removal of Python path management and version detection is safe
The verification process confirms that the removal of Python path management and version detection functionality is safe. No active usages of the removed properties and methods were found in the codebase.
For improved code maintainability, consider cleaning up the following commented-out code:
- In
src/dbt_client/index.ts
: Remove the commented block checking forisPython3
.- In
src/commands/index.ts
: Remove the commented line referencingthis.pythonEnvironment.allPythonPaths
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the removed Python path management and version detection functionality. # Test: Search for the usage of the removed properties and methods. Expect: No occurrences of the removed entities. rg --type typescript -A 5 $'(allPythonPaths|isPython3|getEnvironmentPaths|getEnvironmentDetails)'Length of output: 133
Script:
#!/bin/bash # Description: Verify the usage of the removed Python path management and version detection functionality. # Define custom file types for TypeScript and JavaScript rg --type-add 'ts:*.ts' --type-add 'js:*.js' \ --type ts --type js \ -e 'allPythonPaths' \ -e 'isPython3' \ -e 'getEnvironmentPaths' \ -e 'getEnvironmentDetails' \ -e 'this\.allPythonPaths' \ -e 'this\.isPython3' \ -A 5Length of output: 2394
21-21
: Verify the impact of the constructor parameter removal.The removal of the
telemetry
andcommandProcessExecutionFactory
parameters simplifies thePythonEnvironment
class and aligns with the shift in focus towardsdbtTerminal
.Please ensure that the removal of these parameters does not introduce any issues in other parts of the codebase where the
PythonEnvironment
class is instantiated.Run the following script to verify the constructor usage:
Verification successful
Constructor change verified, usage check recommended
The removal of
telemetry
andcommandProcessExecutionFactory
parameters from thePythonEnvironment
constructor has been confirmed in the class definition (src/manifest/pythonEnvironment.ts).Our search didn't find any direct usage of the
PythonEnvironment
constructor in the codebase. While this suggests the change is likely safe, please consider the following:
- Verify if there are any indirect instantiations or dependency injections of
PythonEnvironment
that might be affected by this change.- Ensure that any code responsible for creating
PythonEnvironment
instances has been updated accordingly.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `PythonEnvironment` constructor. # Test: Search for the constructor usage. Expect: No occurrences of the old constructor signature. rg --type typescript -A 5 $'new PythonEnvironment'Length of output: 86
Script:
#!/bin/bash # Description: Search for PythonEnvironment class definition and usage # Find TypeScript files and search for PythonEnvironment class definition echo "Searching for PythonEnvironment class definition:" fd -e ts | xargs rg "class PythonEnvironment" -A 10 echo "\nSearching for PythonEnvironment constructor usage:" fd -e ts | xargs rg "new PythonEnvironment" -A 5Length of output: 1149
// if (!this.pythonEnvironment.isPython3) { | ||
// const answer = await window.showErrorMessage( | ||
// "Only Python 3 is supported by dbt, please select a Python 3 interpreter", | ||
// PythonInterpreterPromptAnswer.SELECT, | ||
// ); | ||
// if (answer === PythonInterpreterPromptAnswer.SELECT) { | ||
// commands.executeCommand("python.setInterpreter"); | ||
// } | ||
// return false; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Python 3 compatibility before removing the check.
Commenting out the Python 3 check may lead to compatibility issues if the user has a non-Python 3 environment selected. dbt requires Python 3, and removing this check may cause problems for users who are unaware of this requirement.
Consider keeping the Python 3 check and updating the error message to provide more context about why Python 3 is necessary for dbt. For example:
if (!this.pythonEnvironment.isPython3) {
const answer = await window.showErrorMessage(
"dbt requires Python 3 to function correctly. Please select a Python 3 interpreter.",
PythonInterpreterPromptAnswer.SELECT,
);
if (answer === PythonInterpreterPromptAnswer.SELECT) {
commands.executeCommand("python.setInterpreter");
}
return false;
}
This way, users will be informed about the Python 3 requirement and guided to select the correct interpreter.
@mdesmet, let's either remove the commented out code or add a line describing why we have commented it out. |
Overview
Problem
Describe the problem you are solving. Mention the ticket/issue if applicable.
Solution
Describe the implemented solution. Add external references if needed.
Screenshot/Demo
A picture is worth a thousand words. Please highlight the changes if applicable.
How to test
Checklist
README.md
updated and added information about my changerefactor: remove deprecated Python environment API usage
Summary:
Remove deprecated Python environment API usage by commenting out Python 3 checks and logging in
VSCodeCommands
,DBTClient
, andPythonEnvironment
.Key points:
VSCodeCommands
andDBTClient
that logs Python paths and checks for Python 3.allPythonPaths
andisPython3
properties fromPythonEnvironment
.index.ts
incommands
: Commented out logging of Python paths.index.ts
indbt_client
: Commented out Python 3 check.pythonEnvironment.ts
: RemovedallPythonPaths
andisPython3
properties.Generated with ❤️ by ellipsis.dev
Summary by CodeRabbit
Bug Fixes
Refactor
PythonEnvironment
class by removing unused properties and simplifying the constructor, focusing functionality on thedbtTerminal
.