rinchinov / ij-dbt-plugin

intelllij Idea plugin for DBT
https://plugins.jetbrains.com/plugin/23789-dbt
GNU General Public License v3.0
14 stars 1 forks source link

Use Jetbrains SDK to fetch python interpreter #38

Closed stevenayers-bge closed 4 months ago

stevenayers-bge commented 5 months ago

Great work, @rinchinov.

At the moment, the plugin uses the "DBT Interpreter Path" config setting where you specify the python path. Consider using com.jetbrains.python.sdk.PythonSdkUtil instead.

Example: https://github.com/tonybaloney/pycharm-security/blob/5c1ceeb1fb2a18478fa7076a81f9f47fd450e592/src/main/java/security/packaging/PyPackageSecurityScan.kt#L143

rinchinov commented 5 months ago

Hi! @stevenayers-bge thank you for feedback.

Actually plugin already should be able to find python sdk. This part may be undocumented and not obviouse.

I will try to explain:

  1. Firstly plugin use "DBT Interpreter Path" if it not empty
  2. Then plugin tries to get current project's pythonSdk
  3. And if there is no sdk, plugins tries to find "dbt" executable to use it's SDK

This part not well tested, so please, if you found that it didn't works. Please, share with me details about your setup, and steps how to reproduce.

Here the code: https://github.com/rinchinov/ij-dbt-plugin/blob/21b9cd73adffa05e25716c86fe6830f5ab28f7f3/src/main/kotlin/com/github/rinchinov/ijdbtplugin/services/ProjectConfigurations.kt#L96-L133

stevenayers-bge commented 5 months ago

That's great, I'll try it out. Thank you. 🙂

rinchinov commented 4 months ago

@stevenayers-bge did this help you? can I close the issue?

stevenayers-bge commented 4 months ago

@stevenayers-bge did this help you? can I close the issue?

Yes this helped, thanks! Sorry I haven't got around to raising the null string error issue yet - it's on my to do list :)