Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

state:modified --dbt #637

Closed
dlawin opened this issue Jul 6, 2023 · 3 comments
Closed

state:modified --dbt #637

dlawin opened this issue Jul 6, 2023 · 3 comments
Labels
--dbt Issues/features related to the dbt integration enhancement New feature or request stale_immune Immunity to stale bot

Comments

@dlawin
Copy link
Contributor

dlawin commented Jul 6, 2023

Is your feature request related to a problem? Please describe.
I'd like to use the --select state:modified selector with datadiff

Describe the solution you'd like
Select the same models as dbt and diff them

@dlawin dlawin added enhancement New feature or request --dbt Issues/features related to the dbt integration labels Jul 6, 2023
@dlawin dlawin self-assigned this Jul 6, 2023
@github-actions github-actions bot added the triage label Jul 6, 2023
@dlawin
Copy link
Contributor Author

dlawin commented Jul 6, 2023

In order to accomplish this we'll need to require the --state flag like dbt, and pass the location of that manifest along to the dbt package here:

  File "/Users/dan/repos/demo/env/lib/python3.11/site-packages/data_diff/__main__.py", line 311, in main
    dbt_diff(
  File "/Users/dan/repos/demo/env/lib/python3.11/site-packages/data_diff/dbt.py", line 79, in dbt_diff
    models = dbt_parser.get_models(dbt_selection)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dan/repos/demo/env/lib/python3.11/site-packages/data_diff/dbt_parser.py", line 157, in get_models
    return self.get_dbt_selection_models(dbt_selection)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

e.g. current exception:

  File "/Users/dan/repos/demo/env/lib/python3.11/site-packages/dbt/graph/selector_methods.py", line 556, in search
    raise DbtRuntimeError("Got a state selector method, but no comparison manifest")
dbt.exceptions.DbtRuntimeError: Runtime Error
  Got a state selector method, but no comparison manifest

@dlawin dlawin added stale_immune Immunity to stale bot and removed triage labels Jul 10, 2023
vitmrnavek pushed a commit to vitmrnavek/data-diff that referenced this issue Jul 22, 2023
vitmrnavek pushed a commit to vitmrnavek/data-diff that referenced this issue Jul 22, 2023
@dlawin dlawin removed their assignment Nov 10, 2023
@dlawin
Copy link
Contributor Author

dlawin commented Nov 10, 2023

As a workaround before this is added, the DBT_STATE env var can be set to the folder with the "prod" manifest

✗ export DBT_STATE=/Users/dan/repos/my_folder_with_prod_manifest

@dlawin
Copy link
Contributor Author

dlawin commented Nov 14, 2023

As a workaround before this is added, the DBT_STATE env var can be set to the folder with the "prod" manifest

✗ export DBT_STATE=/Users/dan/repos/my_folder_with_prod_manifest

note that this expects the prod manifest to be named manifest.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
--dbt Issues/features related to the dbt integration enhancement New feature or request stale_immune Immunity to stale bot
Projects
None yet
Development

No branches or pull requests

2 participants