Commit d04fc7f
authored
Fixup a bug in the sync polling exec function (#29)
In the case where the response had to poll, there was a silly mistake
where we were reading the wrong field off the response.
Previously:
```julia
julia> RAI.exec(ctx, "nhd-test-1", "nhd-s", """
2 + 2 * 2, "hi", 'a'
""")
ERROR: KeyError: key "id" not found
Stacktrace:
[1] getindex(h::Dict{String, JSON3.Object{Vector{UInt8}, Vector{UInt64}}}, key::String)
@ Base ./dict.jl:481
[2] exec(ctx::Context, database::String, engine::String, source::String; inputs::Nothing, readonly::Bool, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ RAI ~/work/rai-sdk-julia/src/api.jl:403
```
This is now fixed:
```julia
julia> RAI.exec(ctx, "nhd-test-1", "nhd-s", """
2 + 2 * 2, "hi", 'a', "hello", '2', 2.0
""")
Dict{String, Any} with 4 entries:
"metadata" => JSON3.Object[{…
"problems" => Union{}[]
"results" => Pair{String, Arrow.Table}["/:output/Int64/String/…
"transaction" => {…
```1 parent aa7a1ec commit d04fc7f
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
| 409 | + | |
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
422 | 423 | | |
423 | 424 | | |
424 | | - | |
| 425 | + | |
425 | 426 | | |
426 | 427 | | |
427 | 428 | | |
| |||
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
477 | 485 | | |
478 | 486 | | |
479 | 487 | | |
| |||
0 commit comments