state: modified not working in dbt set up using python libraries

The problem I’m having

I am trying to set up dbt build to use state:modified

I have copied over the folder containing manifest.json

However, when I run dbt_build , with full-refresh and state: modified --state ‘path to the previous manifest.json’, dbt_build still recreates the model?

I am on dbt core 1.10.3

Put code inside backticks
  to preserve indentation
    which is especially important 
      for Python and YAML! 

If you’re running dbt Core 1.10.3 through the Python library, state:modified should determine which nodes are selected based on comparison with the previous manifest.json. It does not mean "run the model incrementally.

The important part

If you’re running:

dbt build 
  --full-refresh 
  --state /path/to/previous/manifest 
  --select state:modified

then:

state:modified
        ↓
Select models that changed
        ↓
--full-refresh
        ↓
Rebuild those selected models from scratch

So if the model is selected by state:modified, --full-refresh will intentionally recreate it.

If your intention is: Only build models that have changed, and don’t rebuild unchanged models

then use:

dbt build 
  --state /path/to/previous/manifest 
  --select state:modified

without --full-refresh.

Hi Surya,

Thank you for your response.

The issue I’m facing is that even when there is no change to the model, the model is getting picked up for build. Ideally and as per dbt specs the model should not get picked up for build if I use state:modified whether I pass full-refresh or not