Skip to content

Commit 6ff1df5

Browse files
committed
address PR feedback
1 parent df148ba commit 6ff1df5

File tree

9 files changed

+12
-13
lines changed

9 files changed

+12
-13
lines changed

service/ztests/curl-load-error.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ inputs:
1616
outputs:
1717
- name: stdout
1818
data: |
19-
{"type":"Error","kind":"invalid operation","error":"format detection error\n\tarrows: schema message length exceeds 1 MiB\n\tbsup: BSUP version mismatch: expected 1 found 0\n\tcsup: auto-detection requires seekable input\n\tcsv: line 1: EOF\n\tjson: invalid character 'T' looking for beginning of value\n\tline: auto-detection not supported\n\tparquet: auto-detection requires seekable input\n\tsup: line 1: syntax error\n\ttsv: line 1: EOF\n\tzeek: line 1: bad types/fields definition in zeek header\n\tjsup: line 1: malformed JSUP: bad type object: \"This is not a detectable format.\": unpacker error parsing JSON: invalid character 'T' looking for beginning of value"}
19+
{"type":"Error","kind":"invalid operation","error":"format detection error\n\tarrows: schema message length exceeds 1 MiB\n\tbsup: BSUP version mismatch: expected 1, found 0\n\tcsup: auto-detection requires seekable input\n\tcsv: line 1: EOF\n\tjson: invalid character 'T' looking for beginning of value\n\tline: auto-detection not supported\n\tparquet: auto-detection requires seekable input\n\tsup: line 1: syntax error\n\ttsv: line 1: EOF\n\tzeek: line 1: bad types/fields definition in zeek header\n\tjsup: line 1: malformed JSUP: bad type object: \"This is not a detectable format.\": unpacker error parsing JSON: invalid character 'T' looking for beginning of value"}
2020
code 400
2121
{"type":"Error","kind":"invalid operation","error":"unsupported MIME type: unsupported"}
2222
code 400

service/ztests/load-garbage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ outputs:
1414
data: |
1515
stdio:stdin: format detection error
1616
arrows: schema message length exceeds 1 MiB
17-
bsup: BSUP version mismatch: expected 1 found 0
17+
bsup: BSUP version mismatch: expected 1, found 0
1818
csup: auto-detection requires seekable input
1919
csv: line 1: delimiter ',' not found
2020
json: invalid character 'T' looking for beginning of value

sio/anyio/ztests/detector-dev-zero.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ outputs:
66
data: |
77
/dev/zero: format detection error
88
arrows: arrow/ipc: could not read message schema: EOF
9-
bsup: BSUP version mismatch: expected 1 found 0
9+
bsup: BSUP version mismatch: expected 1, found 0
1010
csup: invalid CSUP header
1111
csv: line 1: bufio: buffer full
1212
json: invalid character '\x00' looking for beginning of value

sio/anyio/ztests/fake-bsup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ inputs:
99
outputs:
1010
- name: stderr
1111
data: |
12-
stdio:stdin: BSUP version mismatch: expected 1 found 0
12+
stdio:stdin: BSUP version mismatch: expected 1, found 0

sio/anyio/ztests/huge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ outputs:
1212
data: |
1313
stdio:stdin: format detection error
1414
arrows: schema message length exceeds 1 MiB
15-
bsup: BSUP version mismatch: expected 1 found 0
15+
bsup: BSUP version mismatch: expected 1, found 0
1616
csup: auto-detection requires seekable input
1717
csv: line 1: delimiter ',' not found
1818
json: buffer exceeded max size trying to infer input format

sio/bsupio/parser.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ type parser struct {
2121
maxSize int
2222
}
2323

24-
const BSUP_VERSION = 1
25-
const BSUP_MAGIC = "BSUP"
24+
const BSUPVersion = 1
2625

2726
func CheckVersion(code byte) error {
2827
var version int
2928
if (code & 0x80) != 0 {
3029
version = int(code & 0x7f)
3130
}
32-
if version != BSUP_VERSION {
33-
return fmt.Errorf("BSUP version mismatch: expected %d found %d", BSUP_VERSION, version)
31+
if version != BSUPVersion {
32+
return fmt.Errorf("BSUP version mismatch: expected %d, found %d", BSUPVersion, version)
3433
}
3534
return nil
3635
}

sio/bsupio/writer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (w *Writer) writeBlock(blockType int, b []byte) error {
166166
}
167167

168168
func (w *Writer) writeHeader(blockType, size int) error {
169-
version := BSUP_VERSION | 0x80
169+
version := BSUPVersion | 0x80
170170
code := blockType<<4 | (size & 0xf)
171171
w.header = append(w.header[:0], byte(version))
172172
w.header = append(w.header, byte(code))
@@ -176,7 +176,7 @@ func (w *Writer) writeHeader(blockType, size int) error {
176176

177177
func (w *Writer) writeCompHeader(blockType, size, zlen int) error {
178178
zlen += 1 + scode.SizeOfUvarint(uint64(size))
179-
version := BSUP_VERSION | 0x80
179+
version := BSUPVersion | 0x80
180180
code := (blockType << 4) | (zlen & 0xf) | 0x40
181181
w.header = append(w.header[:0], byte(version))
182182
w.header = append(w.header, byte(code))

sio/bsupio/ztests/dev-zero.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ script: |
44
outputs:
55
- name: stderr
66
data: |
7-
/dev/zero: BSUP version mismatch: expected 1 found 0
7+
/dev/zero: BSUP version mismatch: expected 1, found 0

sio/bsupio/ztests/issue-4082.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ inputs:
1414
outputs:
1515
- name: stderr
1616
data: |
17-
stdio:stdin: BSUP version mismatch: expected 1 found 0
17+
stdio:stdin: BSUP version mismatch: expected 1, found 0

0 commit comments

Comments
 (0)