From d01bd9a8ead2852b1bb2c069fab01b035a1e9642 Mon Sep 17 00:00:00 2001 From: Mithrandie Date: Sun, 13 Jun 2021 21:07:14 +0900 Subject: [PATCH 1/3] Fix a bug of the "--allow-uneven-fields" option. ([GitHub #59](https://github.com/mithrandie/csvq/issues/59)) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b50163e..306db36 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/mithrandie/csvq require ( github.com/mitchellh/go-homedir v1.0.0 github.com/mithrandie/go-file/v2 v2.0.2 - github.com/mithrandie/go-text v1.4.0 + github.com/mithrandie/go-text v1.4.1 github.com/mithrandie/readline-csvq v1.1.1 github.com/mithrandie/ternary v1.1.0 github.com/urfave/cli v1.20.0 diff --git a/go.sum b/go.sum index 140e4dc..27f24c0 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnG github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mithrandie/go-file/v2 v2.0.2 h1:3/yzItlTssDX9wOZrj9MtRyXbr52OZURmXFMuvpJ6Fg= github.com/mithrandie/go-file/v2 v2.0.2/go.mod h1:98a9loPjYr7ffsfwMDdJ7iH/dO8EXAca8XiI6SZpPV8= -github.com/mithrandie/go-text v1.4.0 h1:hK2i8ydiM3Uc5UqaY/aNz9ztdlNT8RvBJnJLIOX+tUM= -github.com/mithrandie/go-text v1.4.0/go.mod h1:Ivtyn3cuJYAs2UpihWmnY1KAixmLonELJ454EOZGzDg= +github.com/mithrandie/go-text v1.4.1 h1:tLIMamsVRYKsDTIDu7hZifOA4gtwSUln1zrZ9GM0eTU= +github.com/mithrandie/go-text v1.4.1/go.mod h1:Ivtyn3cuJYAs2UpihWmnY1KAixmLonELJ454EOZGzDg= github.com/mithrandie/readline-csvq v1.1.1 h1:kp9W5WPUAB+NOgW5axPdu8mZe1M9CP/D1xpabj39JVY= github.com/mithrandie/readline-csvq v1.1.1/go.mod h1:eOJt0j6UI9lhwM/KP+v40ugarhXsnPIXStvkfIaq79E= github.com/mithrandie/ternary v1.1.0 h1:BlN8EoTsIYjhuWkfXHrh7+G+/Y0VvvWGVVldyjNH2VU= From 1cd4fc508b8535eeef36c310004caf8ee3130849 Mon Sep 17 00:00:00 2001 From: Mithrandie Date: Sun, 13 Jun 2021 22:52:47 +0900 Subject: [PATCH 2/3] Allow empty key names in JSON output. ([GitHub #57](https://github.com/mithrandie/csvq/issues/57)) --- lib/json/cache.go | 3 --- lib/json/conversion_test.go | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/lib/json/cache.go b/lib/json/cache.go index 64ca4c1..61500d3 100644 --- a/lib/json/cache.go +++ b/lib/json/cache.go @@ -34,9 +34,6 @@ func (pmap PathMap) load(key string) (PathExpression, bool) { func (pmap PathMap) Parse(s string) (PathExpression, error) { s = strings.TrimSpace(s) - if len(s) < 1 { - return nil, nil - } if e, ok := pmap.load(s); ok { return e, nil diff --git a/lib/json/conversion_test.go b/lib/json/conversion_test.go index a5a9945..72c59e6 100644 --- a/lib/json/conversion_test.go +++ b/lib/json/conversion_test.go @@ -407,6 +407,48 @@ var convertTableValueToJsonStructureTests = []struct { }, }, }, + { + Fields: []string{ + "column1", + "", + }, + Rows: [][]value.Primary{ + { + value.NewString("a"), + value.NewInteger(1), + }, + { + value.NewString("b"), + value.NewFloat(0.2), + }, + }, + Expect: json.Array{ + json.Object{ + Members: []json.ObjectMember{ + { + Key: "column1", + Value: json.String("a"), + }, + { + Key: "", + Value: json.Integer(1), + }, + }, + }, + json.Object{ + Members: []json.ObjectMember{ + { + Key: "column1", + Value: json.String("b"), + }, + { + Key: "", + Value: json.Float(0.2), + }, + }, + }, + }, + }, { Fields: []string{ "column1", From c07eb5f48089656940fd23bb37dfe2ee1430d2d8 Mon Sep 17 00:00:00 2001 From: Mithrandie Date: Sun, 13 Jun 2021 23:03:21 +0900 Subject: [PATCH 3/3] Update docs for Release v1.15.2. --- CHANGELOG.md | 7 +++++++ docs/changelog.md | 7 +++++++ docs/index.md | 6 +++--- docs/sitemap.xml | 4 ++-- lib/query/version.go | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23afc87..d2b045e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## Version 1.15.2 + +Released on June 13, 2021 + +- Allow empty key names in JSON output. ([GitHub #57](https://github.com/mithrandie/csvq/issues/57)) +- Fix a bug of the "--allow-uneven-fields" option. ([GitHub #59](https://github.com/mithrandie/csvq/issues/59)) + ## Version 1.15.1 Released on May 5, 2021 diff --git a/docs/changelog.md b/docs/changelog.md index 03d99a3..6219d98 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -5,6 +5,13 @@ title: Change Log - csvq # Change Log +## Version 1.15.2 + +Released on June 13, 2021 + +- Allow empty key names in JSON output. ([GitHub #57](https://github.com/mithrandie/csvq/issues/57)) +- Fix a bug of the "--allow-uneven-fields" option. ([GitHub #59](https://github.com/mithrandie/csvq/issues/59)) + ## Version 1.15.1 Released on May 5, 2021 diff --git a/docs/index.md b/docs/index.md index 9b60b01..0eb981e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,10 +13,10 @@ In the multiple operations, you can use variables, cursors, temporary tables, an ## Latest Release -Version 1.15.1 -: Released on May 5, 2021 +Version 1.15.2 +: Released on June 13, 2021 - + file_downloaddownload diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 051ebab..25af5ca 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -6,7 +6,7 @@ http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> https://mithrandie.github.io/csvq/ - 2021-05-05T00:06:28+00:00 + 2021-06-13T14:02:24+00:00 https://mithrandie.github.io/csvq/reference.html @@ -178,7 +178,7 @@ https://mithrandie.github.io/csvq/changelog.html - 2021-05-05T00:06:28+00:00 + 2021-06-13T14:02:24+00:00 https://mithrandie.github.io/csvq/license.html diff --git a/lib/query/version.go b/lib/query/version.go index 07b8a0a..ddd3302 100644 --- a/lib/query/version.go +++ b/lib/query/version.go @@ -1,3 +1,3 @@ package query -var Version = "v1.15.1" +var Version = "v1.15.2"