@@ -54,17 +54,24 @@ df = DataFrame(table);
54
54
```
55
55
"""
56
56
function load (id:: Int ; parser = :arff )
57
- dir = first (Artifacts. artifacts_dirs ())
58
- toml = joinpath (dir, " OpenMLArtifacts.toml" )
59
- hash = artifact_hash (string (id), toml)
60
- if hash === nothing || ! artifact_exists (hash)
61
- hash = Artifacts. create_artifact () do artifact_dir
62
- url = load_Dataset_Description (id)[" data_set_description" ][" url" ]
63
- download (url, joinpath (artifact_dir, " $id .arff" ))
57
+ if VERSION > v " 1.3.0"
58
+ dir = first (Artifacts. artifacts_dirs ())
59
+ toml = joinpath (dir, " OpenMLArtifacts.toml" )
60
+ hash = artifact_hash (string (id), toml)
61
+ if hash === nothing || ! artifact_exists (hash)
62
+ hash = Artifacts. create_artifact () do artifact_dir
63
+ url = load_Dataset_Description (id)[" data_set_description" ][" url" ]
64
+ download (url, joinpath (artifact_dir, " $id .arff" ))
65
+ end
66
+ bind_artifact! (toml, string (id), hash)
64
67
end
65
- bind_artifact! (toml, string (id), hash)
68
+ filename = joinpath (artifact_path (hash), " $id .arff" )
69
+ else
70
+ url = load_Dataset_Description (id)[" data_set_description" ][" url" ]
71
+ filename = tempname ()
72
+ download (url, filename)
66
73
end
67
- data = ARFFFiles. load (joinpath ( artifact_path (hash), " $id .arff " ) )
74
+ data = ARFFFiles. load (filename )
68
75
if parser == :auto
69
76
return coerce (data, autotype (data))
70
77
else
0 commit comments