Commit fce4b92
fix(thoughtspot): SQL View merge read the wrong column key; output paths could collide
Both findings from @jbonofre's second review, and both are defects in code from
this PR's previous two commits rather than pre-existing ones. 859 tests pass.
SQL VIEW COLUMNS WERE DROPPED BY THE MERGE I ADDED. `_deduplicate_table_documents`
merged only `columns`, but a SQL View keeps its output columns under
`sql_view_columns`. Two aliased datasets over one SQL View therefore lost the
second's fields entirely, `build_model` then raised TS-MODEL-COLUMN-ID-MISSING
for the fields that were dropped, and the body-divergence comparison fired
spuriously because it excluded only `columns` too. So the fix for duplicate
Table documents was worse than the defect it replaced.
Reading the wrong column key is this converter's most repeated mistake -- three
separate silent failures now -- so the kind-to-key rule is named once, in
`_column_key_for`, and both call sites use it. The divergence comparison ignores
both keys, and a kind mismatch is itself a divergence.
A RUN COULD DESTROY ITS OWN OUTPUT. `--issues` and `-o` resolving to one path
passed the does-it-already-exist check on a fresh run; `_write_issues` then
replaced the converted document with the JSON issue log and the command exited
0. The same collision was reachable between `--issues` and a generated `to-tml`
filename. Both commands now reject a repeated target before writing anything,
compared after `resolve()` so two spellings of one file are caught, and
regardless of `--force` -- which licenses overwriting files that were already
there, not destroying an output this run just produced.
Both fixes are mutation-checked: reverting either fails the new tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent a05e3b4 commit fce4b92
4 files changed
Lines changed: 170 additions & 8 deletions
File tree
- converters/thoughtspot
- src/ossie_thoughtspot
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
138 | 164 | | |
139 | 165 | | |
140 | 166 | | |
| |||
171 | 197 | | |
172 | 198 | | |
173 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
174 | 204 | | |
175 | 205 | | |
176 | 206 | | |
| |||
212 | 242 | | |
213 | 243 | | |
214 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
215 | 249 | | |
216 | 250 | | |
217 | 251 | | |
| |||
Lines changed: 27 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1182 | 1198 | | |
1183 | 1199 | | |
1184 | 1200 | | |
1185 | | - | |
1186 | | - | |
| 1201 | + | |
1187 | 1202 | | |
1188 | 1203 | | |
1189 | 1204 | | |
| |||
2133 | 2148 | | |
2134 | 2149 | | |
2135 | 2150 | | |
2136 | | - | |
2137 | | - | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
2138 | 2154 | | |
2139 | | - | |
| 2155 | + | |
2140 | 2156 | | |
2141 | 2157 | | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
2142 | 2161 | | |
2143 | | - | |
2144 | | - | |
| 2162 | + | |
| 2163 | + | |
2145 | 2164 | | |
2146 | | - | |
| 2165 | + | |
2147 | 2166 | | |
2148 | 2167 | | |
2149 | 2168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
0 commit comments