serramatutu commented on code in PR #3469:
URL: https://github.com/apache/arrow-adbc/pull/3469#discussion_r2381004529
##########
go/adbc/driver/bigquery/connection.go:
##########
@@ -685,6 +685,19 @@ func sanitizeDataset(value string) (string, error) {
}
}
+// Encode a value as a JSON string. Returns "" in case the value is empty or
if there was
+// an error
+func encodeJson[S ~[]E | ~map[string]E, E any](v S) string {
Review Comment:
This doesn't preserve the current behavior:
```go
if len(v) == 0 {
encoded := ""
} else {
encoded := json.Marshal(v)
}
```
If we just `json.Marshal` a value with length 0 we'll get `[]` instead of
empty string.
We could change to simplify, but that would be a breaking change :D
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]