Skip to content

Commit 0590b89

Browse files
committed
fix current tests
1 parent 8811daa commit 0590b89

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/datasets.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function Dataset(d::Dict; expected_project::Union{UUID, Nothing}=nothing)
217217
end
218218

219219
function Base.propertynames(::Dataset)
220-
return (:owner, :name, :uuid, :dtype, :size, :versions, :description, :tags)
220+
return (:owner, :name, :uuid, :dtype, :size, :versions, :description, :tags, :project)
221221
end
222222

223223
function Base.show(io::IO, d::Dataset)
@@ -695,7 +695,7 @@ function upload_dataset end
695695
# Any other 404 or other non-200 response indicates a backend failure
696696
_throw_invalidresponse(r)
697697
end
698-
upload_config = _check_dataset_upload_config(r, dtype)
698+
upload_config = _check_dataset_upload_config(r, dtype; newly_created_dataset)
699699
# Upload the actual data
700700
try
701701
_upload_dataset(upload_config, local_path; progress)
@@ -720,7 +720,9 @@ function upload_dataset end
720720
return dataset((username, dataset_name); auth)
721721
end
722722

723-
function _check_dataset_upload_config(r::_RESTResponse, expected_dtype::AbstractString)
723+
function _check_dataset_upload_config(
724+
r::_RESTResponse, expected_dtype::AbstractString; newly_created_dataset::Bool
725+
)
724726
upload_config, _ = _parse_response_json(r, Dict)
725727
# Verify that the dtype of the remote dataset is what we expect it to be.
726728
if upload_config["dataset_type"] != expected_dtype

src/projects.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function upload_project_dataset(
202202
_throw_invalidresponse(r)
203203
end
204204
# ...
205-
upload_config = _check_dataset_upload_config(r, dtype)
205+
upload_config = _check_dataset_upload_config(r, dtype; newly_created_dataset=false)
206206
# Upload the actual data
207207
try
208208
_upload_dataset(upload_config, local_path; progress)

test/datasets.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ end
157157
s -> !startswith(string(s), "_"),
158158
fieldnames(JuliaHub.Dataset),
159159
)
160-
@test Set(propertynames(pd._dataset)) == Set(expected)
160+
@test Set(propertynames(ds)) == Set(expected)
161161
end
162162
end
163163
let ds = JuliaHub.dataset(("username", "example-dataset"); throw=false)

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ end
183183
:DefaultApp, :FileHash, :InvalidAuthentication, :InvalidRequestError, :Job,
184184
:WorkloadConfig, :JobFile, :JobLogMessage, :JobReference, :JobStatus,
185185
:JuliaHubConnectionError, :JuliaHubError,
186-
:JuliaHubException,
186+
:JuliaHubException, :InvalidJuliaHubVersion,
187187
:Limit, :NodeSpec, :PackageApp, :PackageJob, :Unlimited,
188188
:PermissionError, :script, :Secret, :UserApp,
189189
:application, :applications, :authenticate,
@@ -198,6 +198,8 @@ end
198198
:nodespec, :nodespecs, :reauthenticate!, :submit_job,
199199
:update_dataset, :upload_dataset, :wait_job,
200200
:request,
201+
:ProjectReference, :ProjectNotSetError, :DatasetProjectLink,
202+
:project_dataset, :project_datasets, :upload_project_dataset,
201203
])
202204
extra_public_symbols = setdiff(public_symbols, expected_public_symbols)
203205
isempty(extra_public_symbols) || @warn """

0 commit comments

Comments
 (0)