dbt-pumpkin 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ __pycache__
2
+ /.hatch
3
+ /.vscode
4
+ /.idea
5
+ /dist
6
+
7
+ #auto-generated
8
+ /dbt_pumpkin/version.py
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.3
2
+ Name: dbt-pumpkin
3
+ Version: 0.0.0
4
+ Project-URL: Source code, https://github.com/kokorin/dbt-pumpkin
5
+ Author-email: Denis Kokorin <kokorin86@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.9
9
+ Requires-Dist: click>=8.1.0
10
+ Requires-Dist: ruamel-yaml>=0.17
11
+ Description-Content-Type: text/markdown
12
+
13
+ # DBT-PUMPKIN
14
+
15
+ `dbt-pumpkin` is a command-line tool which helps to manage [DBT](https://docs.getdbt.com/docs/introduction) projects.
16
+
17
+ Inspired by [dbt-osmosis](https://z3z1ma.github.io/dbt-osmosis/)
18
+
19
+ ## Usage
20
+
21
+ ### Botstrap DBT Resources
22
+
23
+ `dbt-pumpkin` allows to create DBT YAML schema files for Seeds, Models and Snapshots. For that one has to add
24
+ [dbt-pumpking-path](#dbt-pumpkin-path) configuration property for a Resource. Then `dbt-pumpkin` will be able to
25
+ understand where YAML files should be located.
26
+
27
+ By default `dbt-pumpkin` will analyze all project's resources and create **absent** YAML schema definition files. You
28
+ can use `--select` and `--exclude` options to select/exclude a subset of resources. These arguments work exactly the
29
+ same way as they do with `dbt` command (`dbt list` is used under the hood).
30
+
31
+ *Note*: YAML files created by this command will be almost empty. Another command should be used to add
32
+ columns: [synchronize](#synchronize-dbt-resources)
33
+
34
+ ```sh
35
+ dbt-pumpkin bootstrap --help
36
+ Usage: dbt-pumpkin bootstrap [OPTIONS]
37
+
38
+ Bootstraps project by adding missing YAML definitions
39
+
40
+ Options:
41
+ --project-dir TEXT
42
+ --profiles-dir TEXT
43
+ -t, --target TEXT
44
+ --profile TEXT
45
+ -s, --select TEXT
46
+ --exclude TEXT
47
+ --dry-run
48
+ --debug
49
+ --help Show this message and exit.
50
+ ```
51
+
52
+ ### Relocate DBT Resources
53
+
54
+ `dbt-pumpkin` also allows to move DBT YAML schema files for Sources, Seeds, Models and Snapshots. As
55
+ with [bootstrap](#botstrap-dbt-resources) command [dbt-pumpking-path](#dbt-pumpkin-path) configuration property is
56
+ required for a Resource. Then `dbt-pumpkin` will be able to understand where YAML files should be located.
57
+
58
+ *Note*: `dbt-pumking` can split YAML schema file (if it contains several Resources) into separate YAML file, or,
59
+ alternatively, it can merge several YAML files into one. This is all configured by `dbt-pumpking-path`.
60
+
61
+ ```sh
62
+ dbt-pumpkin relocate --help
63
+ Usage: dbt-pumpkin relocate [OPTIONS]
64
+
65
+ Relocates YAML definitions according to dbt-pumpkin-path configuration
66
+
67
+ Options:
68
+ --project-dir TEXT
69
+ --profiles-dir TEXT
70
+ -t, --target TEXT
71
+ --profile TEXT
72
+ -s, --select TEXT
73
+ --exclude TEXT
74
+ --dry-run
75
+ --debug
76
+ --help Show this message and exit.
77
+ ```
78
+
79
+ ### Synchronize DBT Resources
80
+
81
+ Last, but not least, feature is `synchronize`. It analyzes schema of actual tables and views in your database and
82
+ updates YAML schema files to have the same columns (and column types) in the same order as they are in a table/view
83
+ corresponding to a Resource.
84
+
85
+ Pay attention, that columns declared in YAML but absent in the database will be deleted. But you are using version
86
+ control system (and most probably it's git), right? So you can always revert changes done by `dbt-pumpkin` if, for
87
+ example, you forgot to run/build a Resource and its table/view is outdated.
88
+
89
+ *Note* `dbt-pumpkin` leaves intact any descriptions, tests and any other properties set in YAML file.
90
+
91
+ ```sh
92
+ dbt-pumpkin synchronize --help
93
+ Usage: dbt-pumpkin synchronize [OPTIONS]
94
+
95
+ Synchronizes YAML definitions with actual tables in DB
96
+
97
+ Options:
98
+ --project-dir TEXT
99
+ --profiles-dir TEXT
100
+ -t, --target TEXT
101
+ --profile TEXT
102
+ -s, --select TEXT
103
+ --exclude TEXT
104
+ --dry-run
105
+ --debug
106
+ --help Show this message and exit.
107
+ ```
108
+
109
+ ## Configuration
110
+
111
+ ### `dbt-pumpkin-path`
112
+
113
+ `dbt-pumpkin-path` is the only configuration property supported for now.
114
+
115
+ It sets a path to YAML schema file of a resource. The path can relative to resource (SQL, CSV or PY) or root-relative.
116
+ Root-relative paths set path relative to DBT project root directory and start with `/` symbol.
117
+
118
+ #### Examples
119
+
120
+ Configure `dbt-pumpkin` to bootstrap resources at (or relocate resources to) `_schema.yml` file located **next to**
121
+ SQL, CSV or PY file.
122
+
123
+ ```yaml
124
+ models:
125
+ "<YOU_PROJECT_NAME>":
126
+ +dbt-pumpkin-path: _schema.yml
127
+ seeds:
128
+ "<YOU_PROJECT_NAME>":
129
+ +dbt-pumpkin-path: _schema.yml
130
+ snapshots:
131
+ "<YOU_PROJECT_NAME>":
132
+ +dbt-pumpkin-path: _schema.yml
133
+ ```
134
+
135
+ You your Model is called `my_model` and is defined at `models/path/to/my_model.sql`, then `dbt-pumpkin` will consider
136
+ `models/path/to/_schema.yml` as the path were the model should be bootstrapped at or relocated to.
137
+
138
+ Of course, as with any other DBT configuration property, you can re-define `dbt-pumpkin-path` on resources you want:
139
+
140
+ ```yaml
141
+ models:
142
+ "<YOU_PROJECT_NAME>":
143
+ +dbt-pumpkin-path: _schema.yml
144
+ intermediate:
145
+ int_my_model:
146
+ +dbt-pumpkin-path: int_my_model.yml
147
+ ```
148
+
149
+ `dbt-pumpkin-path` actually defines **template** path and supports `{name}` and `{parent}` values. `{name}` gets
150
+ replaced with Resource's name and `{parent}` - with folder's name where resource SQL, CSV or PY file is located.
151
+
152
+ ```yaml
153
+ models:
154
+ "<YOU_PROJECT_NAME>":
155
+ +dbt-pumpkin-path: _{name}.yml
156
+ ```
157
+
158
+ With the above configuration, every resource will be relocated to (bootstrapped at) separate YAML file, so `my_model`
159
+ will be defined at `_my_model.yml`.
160
+
161
+ In case you have too many resourced defined in a directory, you may specify subdirectory to hold YAML files:
162
+
163
+ ```yaml
164
+ models:
165
+ "<YOU_PROJECT_NAME>":
166
+ +dbt-pumpkin-path: _schema/{name}.yml
167
+ ```
168
+
169
+ Source in DBT have no other files except YAML. It means that it's not possible to use relative path
170
+ in `dbt-pumpkin-path` to configure source YAML file location. The only option is to use root-relative paths:
171
+
172
+
173
+ ```yaml
174
+ sources:
175
+ "<YOU_PROJECT_NAME>":
176
+ # root-relative path must start with /
177
+ +dbt-pumpkin-path: /models/staging/_source_{name}.yml
178
+ ```
179
+
180
+ ## Development
181
+
182
+ ```sh
183
+ # First install Hatch globally
184
+ pip install hatch
185
+
186
+ # Configure Hatch to create venvs in project
187
+ hatch config set dirs.env.virtual .hatch
188
+
189
+ # Before testing we need to build DBT project
190
+ hatch run dbt clean
191
+ hatch run dbt seed
192
+ hatch run dbt build
193
+
194
+ # test in one venv
195
+ hatch test
196
+ # test across different python & dbt versions
197
+ hatch test --all
198
+ ```
199
+
200
+ ## Troubleshooting
201
+
202
+ Clean envs and caches:
203
+
204
+ ```sh
205
+ hatch env prune
206
+ pip cache purge
207
+ # UV is used by default for hatch-test environments
208
+ uv cache clean
209
+ ```
@@ -0,0 +1,197 @@
1
+ # DBT-PUMPKIN
2
+
3
+ `dbt-pumpkin` is a command-line tool which helps to manage [DBT](https://docs.getdbt.com/docs/introduction) projects.
4
+
5
+ Inspired by [dbt-osmosis](https://z3z1ma.github.io/dbt-osmosis/)
6
+
7
+ ## Usage
8
+
9
+ ### Botstrap DBT Resources
10
+
11
+ `dbt-pumpkin` allows to create DBT YAML schema files for Seeds, Models and Snapshots. For that one has to add
12
+ [dbt-pumpking-path](#dbt-pumpkin-path) configuration property for a Resource. Then `dbt-pumpkin` will be able to
13
+ understand where YAML files should be located.
14
+
15
+ By default `dbt-pumpkin` will analyze all project's resources and create **absent** YAML schema definition files. You
16
+ can use `--select` and `--exclude` options to select/exclude a subset of resources. These arguments work exactly the
17
+ same way as they do with `dbt` command (`dbt list` is used under the hood).
18
+
19
+ *Note*: YAML files created by this command will be almost empty. Another command should be used to add
20
+ columns: [synchronize](#synchronize-dbt-resources)
21
+
22
+ ```sh
23
+ dbt-pumpkin bootstrap --help
24
+ Usage: dbt-pumpkin bootstrap [OPTIONS]
25
+
26
+ Bootstraps project by adding missing YAML definitions
27
+
28
+ Options:
29
+ --project-dir TEXT
30
+ --profiles-dir TEXT
31
+ -t, --target TEXT
32
+ --profile TEXT
33
+ -s, --select TEXT
34
+ --exclude TEXT
35
+ --dry-run
36
+ --debug
37
+ --help Show this message and exit.
38
+ ```
39
+
40
+ ### Relocate DBT Resources
41
+
42
+ `dbt-pumpkin` also allows to move DBT YAML schema files for Sources, Seeds, Models and Snapshots. As
43
+ with [bootstrap](#botstrap-dbt-resources) command [dbt-pumpking-path](#dbt-pumpkin-path) configuration property is
44
+ required for a Resource. Then `dbt-pumpkin` will be able to understand where YAML files should be located.
45
+
46
+ *Note*: `dbt-pumking` can split YAML schema file (if it contains several Resources) into separate YAML file, or,
47
+ alternatively, it can merge several YAML files into one. This is all configured by `dbt-pumpking-path`.
48
+
49
+ ```sh
50
+ dbt-pumpkin relocate --help
51
+ Usage: dbt-pumpkin relocate [OPTIONS]
52
+
53
+ Relocates YAML definitions according to dbt-pumpkin-path configuration
54
+
55
+ Options:
56
+ --project-dir TEXT
57
+ --profiles-dir TEXT
58
+ -t, --target TEXT
59
+ --profile TEXT
60
+ -s, --select TEXT
61
+ --exclude TEXT
62
+ --dry-run
63
+ --debug
64
+ --help Show this message and exit.
65
+ ```
66
+
67
+ ### Synchronize DBT Resources
68
+
69
+ Last, but not least, feature is `synchronize`. It analyzes schema of actual tables and views in your database and
70
+ updates YAML schema files to have the same columns (and column types) in the same order as they are in a table/view
71
+ corresponding to a Resource.
72
+
73
+ Pay attention, that columns declared in YAML but absent in the database will be deleted. But you are using version
74
+ control system (and most probably it's git), right? So you can always revert changes done by `dbt-pumpkin` if, for
75
+ example, you forgot to run/build a Resource and its table/view is outdated.
76
+
77
+ *Note* `dbt-pumpkin` leaves intact any descriptions, tests and any other properties set in YAML file.
78
+
79
+ ```sh
80
+ dbt-pumpkin synchronize --help
81
+ Usage: dbt-pumpkin synchronize [OPTIONS]
82
+
83
+ Synchronizes YAML definitions with actual tables in DB
84
+
85
+ Options:
86
+ --project-dir TEXT
87
+ --profiles-dir TEXT
88
+ -t, --target TEXT
89
+ --profile TEXT
90
+ -s, --select TEXT
91
+ --exclude TEXT
92
+ --dry-run
93
+ --debug
94
+ --help Show this message and exit.
95
+ ```
96
+
97
+ ## Configuration
98
+
99
+ ### `dbt-pumpkin-path`
100
+
101
+ `dbt-pumpkin-path` is the only configuration property supported for now.
102
+
103
+ It sets a path to YAML schema file of a resource. The path can relative to resource (SQL, CSV or PY) or root-relative.
104
+ Root-relative paths set path relative to DBT project root directory and start with `/` symbol.
105
+
106
+ #### Examples
107
+
108
+ Configure `dbt-pumpkin` to bootstrap resources at (or relocate resources to) `_schema.yml` file located **next to**
109
+ SQL, CSV or PY file.
110
+
111
+ ```yaml
112
+ models:
113
+ "<YOU_PROJECT_NAME>":
114
+ +dbt-pumpkin-path: _schema.yml
115
+ seeds:
116
+ "<YOU_PROJECT_NAME>":
117
+ +dbt-pumpkin-path: _schema.yml
118
+ snapshots:
119
+ "<YOU_PROJECT_NAME>":
120
+ +dbt-pumpkin-path: _schema.yml
121
+ ```
122
+
123
+ You your Model is called `my_model` and is defined at `models/path/to/my_model.sql`, then `dbt-pumpkin` will consider
124
+ `models/path/to/_schema.yml` as the path were the model should be bootstrapped at or relocated to.
125
+
126
+ Of course, as with any other DBT configuration property, you can re-define `dbt-pumpkin-path` on resources you want:
127
+
128
+ ```yaml
129
+ models:
130
+ "<YOU_PROJECT_NAME>":
131
+ +dbt-pumpkin-path: _schema.yml
132
+ intermediate:
133
+ int_my_model:
134
+ +dbt-pumpkin-path: int_my_model.yml
135
+ ```
136
+
137
+ `dbt-pumpkin-path` actually defines **template** path and supports `{name}` and `{parent}` values. `{name}` gets
138
+ replaced with Resource's name and `{parent}` - with folder's name where resource SQL, CSV or PY file is located.
139
+
140
+ ```yaml
141
+ models:
142
+ "<YOU_PROJECT_NAME>":
143
+ +dbt-pumpkin-path: _{name}.yml
144
+ ```
145
+
146
+ With the above configuration, every resource will be relocated to (bootstrapped at) separate YAML file, so `my_model`
147
+ will be defined at `_my_model.yml`.
148
+
149
+ In case you have too many resourced defined in a directory, you may specify subdirectory to hold YAML files:
150
+
151
+ ```yaml
152
+ models:
153
+ "<YOU_PROJECT_NAME>":
154
+ +dbt-pumpkin-path: _schema/{name}.yml
155
+ ```
156
+
157
+ Source in DBT have no other files except YAML. It means that it's not possible to use relative path
158
+ in `dbt-pumpkin-path` to configure source YAML file location. The only option is to use root-relative paths:
159
+
160
+
161
+ ```yaml
162
+ sources:
163
+ "<YOU_PROJECT_NAME>":
164
+ # root-relative path must start with /
165
+ +dbt-pumpkin-path: /models/staging/_source_{name}.yml
166
+ ```
167
+
168
+ ## Development
169
+
170
+ ```sh
171
+ # First install Hatch globally
172
+ pip install hatch
173
+
174
+ # Configure Hatch to create venvs in project
175
+ hatch config set dirs.env.virtual .hatch
176
+
177
+ # Before testing we need to build DBT project
178
+ hatch run dbt clean
179
+ hatch run dbt seed
180
+ hatch run dbt build
181
+
182
+ # test in one venv
183
+ hatch test
184
+ # test across different python & dbt versions
185
+ hatch test --all
186
+ ```
187
+
188
+ ## Troubleshooting
189
+
190
+ Clean envs and caches:
191
+
192
+ ```sh
193
+ hatch env prune
194
+ pip cache purge
195
+ # UV is used by default for hatch-test environments
196
+ uv cache clean
197
+ ```
File without changes