Commit 38a8910
authored
Fix: escape and truncate default query tag values (#1273)
<!-- Please review our pull request review process in CONTRIBUTING.md
before your proceed. -->
Resolves #
<!---
Include the number of the issue addressed by this PR above if
applicable.
Example:
resolves #1234
Please review our pull request review process in CONTRIBUTING.md before
your proceed.
-->
### Description
Fix to ensure that default (i.e. auto) query tag values are not invalid
- Escape special characters (FWIW, model names are more restrictive than
query tag values but doesn't hurt to have extra layer of defense)
- Truncate values greater than 128 characters
Tested using a model with name
`accepted_values_backhaulcontractschedule_site_category_3__Non_Served_Sites__New_Sites__Served_Sites__Non_HS_Sites__Served_Site__CHARACTERS_BEYOND_128`
<img width="786" height="209" alt="Screenshot 2025-11-25 at 3 11 37 PM"
src="https://github.com/user-attachments/assets/924fc881-020f-4637-832a-36140df6c400"
/>
### Checklist
- [ ] I have run this code in development and it appears to resolve the
stated issue
- [ ] This PR includes tests, or tests are not required/relevant for
this PR
- [ ] I have updated the `CHANGELOG.md` and added information about my
change to the "dbt-databricks next" section.1 parent bfcb5c7 commit 38a8910
File tree
3 files changed
+131
-27
lines changed- dbt/adapters/databricks
- tests/unit
3 files changed
+131
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
| |||
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
159 | | - | |
| 173 | + | |
160 | 174 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 175 | + | |
168 | 176 | | |
169 | | - | |
| 177 | + | |
170 | 178 | | |
171 | 179 | | |
172 | 180 | | |
| |||
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
184 | 214 | | |
185 | 215 | | |
186 | 216 | | |
| |||
191 | 221 | | |
192 | 222 | | |
193 | 223 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 224 | + | |
| 225 | + | |
198 | 226 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
202 | 230 | | |
203 | 231 | | |
204 | 232 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
208 | 236 | | |
209 | | - | |
210 | | - | |
| 237 | + | |
211 | 238 | | |
212 | 239 | | |
213 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
141 | 214 | | |
142 | 215 | | |
143 | 216 | | |
| |||
0 commit comments