felipecrv commented on code in PR #3469:
URL: https://github.com/apache/arrow-adbc/pull/3469#discussion_r2382578538
##########
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:
@serramatutu can you skip setting the value on metadata altogether when its
empty?
Going from
```go
metadata["Labels"] = encodeJson[map[string]string, string](md.Labels)
```
to something like this:
```go
encodeJson[map[string]string, string](metadata, "Labels", md.Labels)
```
Helping reduce the bloat caused by keys in the metadata map and reducing the
number of possible states to "either it exists with something or is not set at
all".
--
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]