altertable-lakehouse 0.8.0 → 0.8.1
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.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/altertable/lakehouse/client.rb +24 -5
- data/lib/altertable/lakehouse/errors.rb +21 -0
- data/lib/altertable/lakehouse/version.rb +1 -1
- data/rbi/altertable/lakehouse.rbi +21 -0
- data/sig/altertable/lakehouse/errors.rbs +16 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c92cf2b0a1bf2f44a8d3b2e7934a5b9f3399293409333cbd19e5749158272176
|
|
4
|
+
data.tar.gz: 44e709abf74aa54c03345afd11ddfb15be5aec1fff1f76722fad1d05a7c9499d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a01c990cd7454973a878bf9a7835e9bf19b1795ba44209aa9d844e88188af31b36712b4fbcfa4ce7de503401bc5faaa3d266324da944f17d1f52b05de217d55
|
|
7
|
+
data.tar.gz: 75b2e70e21eec5de857922989fbbb3aee671905298dd1645e8da56d26791eb41ee29112769f03aafc08d6903d0b1f578eb7561e37bf6d3dc9095de36cf2b20a1
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,13 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
* Support named and positional bind values through `QueryRequest#params`.
|
|
10
10
|
|
|
11
|
+
## [0.8.1](https://github.com/altertable-ai/altertable-lakehouse-ruby/compare/altertable-lakehouse/v0.8.0...altertable-lakehouse/v0.8.1) (2026-10-07)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **error:** implement proper query error parsing ([#54](https://github.com/altertable-ai/altertable-lakehouse-ruby/issues/54)) ([86f6512](https://github.com/altertable-ai/altertable-lakehouse-ruby/commit/86f6512cfc6c58822981d0ac4824b7479dd1f2f4))
|
|
17
|
+
|
|
11
18
|
## [0.8.0](https://github.com/altertable-ai/altertable-lakehouse-ruby/compare/altertable-lakehouse/v0.7.0...altertable-lakehouse/v0.8.0) (2026-10-07)
|
|
12
19
|
|
|
13
20
|
|
data/Gemfile.lock
CHANGED
|
@@ -292,14 +292,24 @@ module Altertable
|
|
|
292
292
|
end
|
|
293
293
|
|
|
294
294
|
def each(&block)
|
|
295
|
-
# The
|
|
296
|
-
# line 1:
|
|
297
|
-
# line 2:
|
|
298
|
-
# line 3+:
|
|
299
|
-
#
|
|
295
|
+
# The mock streams NDJSON:
|
|
296
|
+
# line 1: metadata object
|
|
297
|
+
# line 2: column descriptors, or { "error": string }
|
|
298
|
+
# line 3+: row arrays, or { "error": string }
|
|
299
|
+
# Row arrays are zipped with column names into hashes.
|
|
300
300
|
line_index = 0
|
|
301
301
|
|
|
302
302
|
@enum.each do |item|
|
|
303
|
+
if line_index.positive? && (message = stream_error_message(item))
|
|
304
|
+
raise QueryError.new(
|
|
305
|
+
message,
|
|
306
|
+
line_index: line_index,
|
|
307
|
+
operation: "query",
|
|
308
|
+
http_method: "POST",
|
|
309
|
+
http_path: "/query"
|
|
310
|
+
)
|
|
311
|
+
end
|
|
312
|
+
|
|
303
313
|
case line_index
|
|
304
314
|
when 0
|
|
305
315
|
@metadata = item
|
|
@@ -318,6 +328,15 @@ module Altertable
|
|
|
318
328
|
|
|
319
329
|
private
|
|
320
330
|
|
|
331
|
+
# A post-metadata JSON object with an `error` string is a stream failure,
|
|
332
|
+
# not column schema or a row.
|
|
333
|
+
def stream_error_message(item)
|
|
334
|
+
return unless item.is_a?(Hash)
|
|
335
|
+
|
|
336
|
+
message = item["error"]
|
|
337
|
+
message if message.is_a?(String)
|
|
338
|
+
end
|
|
339
|
+
|
|
321
340
|
# The query service emits typed column descriptors, such as
|
|
322
341
|
# { "name" => "id", "type" => "INTEGER" }. Keep the public result
|
|
323
342
|
# shape stable by exposing names and using them as row keys.
|
|
@@ -21,6 +21,27 @@ module Altertable
|
|
|
21
21
|
class TimeoutError < Error; end
|
|
22
22
|
class SerializationError < Error; end
|
|
23
23
|
class ParseError < Error; end
|
|
24
|
+
|
|
25
|
+
# Backend-emitted `{ "error": string }` line in a /query NDJSON stream.
|
|
26
|
+
# `line_index` is the zero-based index of that line.
|
|
27
|
+
class QueryError < Error
|
|
28
|
+
attr_reader :line_index
|
|
29
|
+
|
|
30
|
+
def initialize(message, line_index:, operation: nil, http_method: nil, http_path: nil, status_code: nil, retriable: false, request_id: nil, cause: nil)
|
|
31
|
+
super(
|
|
32
|
+
message,
|
|
33
|
+
operation: operation,
|
|
34
|
+
http_method: http_method,
|
|
35
|
+
http_path: http_path,
|
|
36
|
+
status_code: status_code,
|
|
37
|
+
retriable: retriable,
|
|
38
|
+
request_id: request_id,
|
|
39
|
+
cause: cause
|
|
40
|
+
)
|
|
41
|
+
@line_index = line_index
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
24
45
|
class ApiError < Error; end
|
|
25
46
|
class ConfigurationError < Error; end
|
|
26
47
|
end
|
|
@@ -47,6 +47,27 @@ module Altertable
|
|
|
47
47
|
class TimeoutError < Error; end
|
|
48
48
|
class SerializationError < Error; end
|
|
49
49
|
class ParseError < Error; end
|
|
50
|
+
|
|
51
|
+
class QueryError < Error
|
|
52
|
+
sig { returns(Integer) }
|
|
53
|
+
def line_index; end
|
|
54
|
+
|
|
55
|
+
sig do
|
|
56
|
+
params(
|
|
57
|
+
message: String,
|
|
58
|
+
line_index: Integer,
|
|
59
|
+
operation: T.nilable(String),
|
|
60
|
+
http_method: T.nilable(String),
|
|
61
|
+
http_path: T.nilable(String),
|
|
62
|
+
status_code: T.nilable(Integer),
|
|
63
|
+
retriable: T::Boolean,
|
|
64
|
+
request_id: T.nilable(String),
|
|
65
|
+
cause: T.nilable(Exception)
|
|
66
|
+
).void
|
|
67
|
+
end
|
|
68
|
+
def initialize(message, line_index:, operation: nil, http_method: nil, http_path: nil, status_code: nil, retriable: false, request_id: nil, cause: nil); end
|
|
69
|
+
end
|
|
70
|
+
|
|
50
71
|
class ApiError < Error; end
|
|
51
72
|
class ConfigurationError < Error; end
|
|
52
73
|
|
|
@@ -39,6 +39,22 @@ module Altertable
|
|
|
39
39
|
class ParseError < Error
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
class QueryError < Error
|
|
43
|
+
attr_reader line_index: Integer
|
|
44
|
+
|
|
45
|
+
def initialize: (
|
|
46
|
+
String message,
|
|
47
|
+
line_index: Integer,
|
|
48
|
+
?operation: String?,
|
|
49
|
+
?http_method: String?,
|
|
50
|
+
?http_path: String?,
|
|
51
|
+
?status_code: Integer?,
|
|
52
|
+
?retriable: bool,
|
|
53
|
+
?request_id: String?,
|
|
54
|
+
?cause: Exception?
|
|
55
|
+
) -> void
|
|
56
|
+
end
|
|
57
|
+
|
|
42
58
|
class ApiError < Error
|
|
43
59
|
end
|
|
44
60
|
|