Skip to content

Commit a2f678e

Browse files
committed
refactor: _config -> _json in Dataset
Rename this internal field to be consistent with other types.
1 parent 0a66ed3 commit a2f678e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/datasets.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Base.@kwdef struct Dataset
5555
_storage::_DatasetStorage
5656
# Should not be used in code, but stores the full server
5757
# response for developer convenience.
58-
_config::Dict
58+
_json::Dict
5959
end
6060

6161
function Dataset(d::Dict)
@@ -82,7 +82,7 @@ function Dataset(d::Dict)
8282
bucket=d["storage"]["bucket"],
8383
prefix=d["storage"]["prefix"],
8484
),
85-
_config=d,
85+
_json=d,
8686
)
8787
end
8888

test/datasets-live.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ try
142142
dataset = JuliaHub.dataset(blobname; auth)
143143
@test dataset.description == "some blob"
144144
@test dataset.tags == ["x", "y", "z"]
145-
@test dataset._config["groups"] == []
146-
@test dataset._config["visibility"] == "private"
147-
@test dataset._config["license"] == Dict{String, Any}(
145+
@test dataset._json["groups"] == []
146+
@test dataset._json["visibility"] == "private"
147+
@test dataset._json["license"] == Dict{String, Any}(
148148
"name" => "Other",
149149
"spdx_id" => "NOASSERTION",
150150
"text" => "All rights reserved",
@@ -155,9 +155,9 @@ try
155155
dataset = JuliaHub.dataset(blobname; auth)
156156
@test dataset.description == "some blob"
157157
@test dataset.tags == ["x", "y", "z"]
158-
@test dataset._config["groups"] == []
159-
@test dataset._config["visibility"] == "private"
160-
@test dataset._config["license"] == Dict{String, Any}(
158+
@test dataset._json["groups"] == []
159+
@test dataset._json["visibility"] == "private"
160+
@test dataset._json["license"] == Dict{String, Any}(
161161
"name" => "Other",
162162
"spdx_id" => "NOASSERTION",
163163
"text" => "All rights reserved",
@@ -170,9 +170,9 @@ try
170170
dataset = JuliaHub.dataset(blobname; auth)
171171
@test dataset.description == "new description"
172172
@test dataset.tags == ["x", "y", "z"]
173-
@test dataset._config["groups"] == []
174-
@test dataset._config["visibility"] == "private"
175-
@test dataset._config["license"] == Dict{String, Any}(
173+
@test dataset._json["groups"] == []
174+
@test dataset._json["visibility"] == "private"
175+
@test dataset._json["license"] == Dict{String, Any}(
176176
"name" => "Other",
177177
"spdx_id" => "NOASSERTION",
178178
"text" => "All rights reserved",
@@ -186,9 +186,9 @@ try
186186
dataset = JuliaHub.dataset(blobname; auth)
187187
@test dataset.description == "new description"
188188
@test dataset.tags == ["foo", "bar"]
189-
@test Set(dataset._config["groups"]) == Set(new_groups)
190-
@test dataset._config["visibility"] == "public"
191-
@test dataset._config["license"] == Dict{String, Any}(
189+
@test Set(dataset._json["groups"]) == Set(new_groups)
190+
@test dataset._json["visibility"] == "public"
191+
@test dataset._json["license"] == Dict{String, Any}(
192192
"name" => "Other",
193193
"spdx_id" => "NOASSERTION",
194194
"text" => "All rights reserved",
@@ -197,7 +197,7 @@ try
197197
# License updates
198198
JuliaHub.update_dataset(dataset.name; auth, license="MIT")
199199
dataset = JuliaHub.dataset(blobname; auth)
200-
@test dataset._config["license"] == Dict{String, Any}(
200+
@test dataset._json["license"] == Dict{String, Any}(
201201
"name" => "MIT License",
202202
"spdx_id" => "MIT",
203203
"text" => nothing,
@@ -207,7 +207,7 @@ try
207207
dataset.name; auth, license=(:text, "hello license my old friend")
208208
)
209209
dataset = JuliaHub.dataset(blobname; auth)
210-
@test dataset._config["license"] == Dict{String, Any}(
210+
@test dataset._json["license"] == Dict{String, Any}(
211211
"name" => "Other",
212212
"spdx_id" => "NOASSERTION",
213213
"text" => "hello license my old friend",

0 commit comments

Comments
 (0)