Commit c1d66dc
committed
[SEA-NodeJS] Address review: test the AsyncStatement arm; type-guard; null + stale comments
- F1: add coverage for the directResults Running (AsyncStatement) arm — the
branch the PR exists to add. Three tests via the fake's `directReturnsRunning`:
(a) a still-running query routes through the AsyncStatement arm and is driven
via `status()`/`waitUntilReady()`; (b) `op.cancel()` reaches the running
statement's `cancel()`; (c) contrast — a fast query routes through the terminal
`Statement` arm and cancel reaches it there. Previously `directReturnsRunning`
was never set, so the async arm had zero coverage.
- F4: replace the `as unknown as` double-casts with a cast-free user-defined type
guard `isSeaAsyncStatement` (the napi `Statement`/`AsyncStatement` are the exact
alias types, so no laundering is needed). Idiomatic, narrows both arms.
- F5: reject a null/undefined `direct` up front via `logAndMapError`
(HiveDriverError) instead of the inconsistent `direct !== null` guard that let a
null fall through to the `{statement}` arm and defer an opaque TypeError.
- F3: update the stale `runAsync` selector comment (still described
`executeStatementCancellable` + blocking `result()`) to directResults; fix the
stale `executeStatementCancellable` comment in the test.
- Document the `queryTimeout`→`wait_timeout=Ns`+CANCEL interaction (a timeout
shorter than the query cancels it rather than returning the Running handle).
SEA unit suite 263 passing (3 new); eslint clean.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent bb749d6 commit c1d66dc
2 files changed
Lines changed: 79 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
| |||
164 | 177 | | |
165 | 178 | | |
166 | 179 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
174 | 190 | | |
175 | 191 | | |
176 | 192 | | |
| |||
193 | 209 | | |
194 | 210 | | |
195 | 211 | | |
196 | | - | |
| 212 | + | |
197 | 213 | | |
198 | 214 | | |
199 | 215 | | |
| |||
202 | 218 | | |
203 | 219 | | |
204 | 220 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
210 | 235 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 236 | + | |
216 | 237 | | |
217 | 238 | | |
218 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
570 | 609 | | |
571 | 610 | | |
572 | 611 | | |
| |||
696 | 735 | | |
697 | 736 | | |
698 | 737 | | |
699 | | - | |
| 738 | + | |
700 | 739 | | |
701 | 740 | | |
702 | 741 | | |
| |||
0 commit comments