PyCharm x dbt: nested dbt_project.yml not recognized

Hi PyCharm Community!

I am facing an issue when using the core DBT module.

My project architecture is composed of multiple blocks (Python application, Dagster Orchestrator, etc.), one being a dbt project. Nevertheless, it seems that, as the dbt_project.yml it is not at the root of the project directory, PyCharm dbt does not recognize it as such, which implies that all my dbt models are recognized as standard sql scripts.

Here is a more detailed explanation:

My project has the following structure:

my_project/
	pyproject.toml
	(...)
	project_src/
		__init__.py
		my_app/
			(...)
		my_orchestration/
			(...)
		my_dbt/
			dbt_project.yml
			models/
				my_model.sql
			(...)

 

When I run a dbt debug, it generate the following obvious error as the dbt_project.yml is not at the root but in another folder:

Project loading failed for the following reason:
 project path <D:\(...)\my_project\dbt_project.yml> not found

 

I have checked the options but I can only change the “Module” in the "Run/Debug Configuration, and the only available choice is my_project

Nevertheless, if I open a PyCharm project at the root of the dbt project (my_dbt folder), it does recognize it as a dbt project, which implies to manage two PyCharm projects depending on what I want to modify in my real project…


My questions are the following:

1) Can PyCharm dbt module work only when it's a pure dbt project (root of the PyCharm project) or can it work when it's nested within an existing project

2) If it can work when it's not a pure dbt project, how to configure PyCharm so that it recognize it that way?

 

Thank you very much for all the help you could provide on that topic!

0
2 comments

Hi Gil Lampe, May I ask which PyCharm version you’re currently using? There was a known issue (DS-5814) affecting this functionality, but it has been resolved in recent versions. I’ve tested it in PyCharm 2025.1.3 and couldn’t reproduce the issue.

If you're still experiencing this behavior with the latest release, please consider submitting a ticket on YouTrack: https://youtrack.jetbrains.com/issues/PY. Including relevant logs or project details will help us investigate more efficiently.

0

Hi Mikhail Tarabrikov ,

Thank you very much for your fast answer!

I am using the Pycharm 2025.1.1 version, I'll try to update it to the latest version and see if it works better first - if not, I'll submit a ticket to YouTrack as recommended.

Thanks a lot for your help!

 

0

Please sign in to leave a comment.