Hello
I am trying to read a file on Google drive without mapping it to a drive on Windows. The reasons I don’t want to map the drive are:
1- users may map to a different letter (I’m on Windows) and I don’t want to deal with different type of OS.
2- one of the subdirectory name contains square brackets ‘[’…]'.
Square brackets are poorly hadled with VS Code on Windows. I think this is related to Powershell. For instance
julia> filename = "H:\\Disques partagés\\[CQ] Rapports\\Netbox\\2023netbox_devices_2023-08-30.csv"
"H:\\Disques partagés\\[CQ] Rapports\\Netbox\\2023netbox_devices_2023-08-30.csv"
julia> isvalid(filename)
true
julia> df = CSV.read(filename, DataFrame)
ERROR: ArgumentError: "H:\Disques partagés\[CQ] Rapports\Netbox\2023netbox_devices_2023-08-30.csv" is not a valid file or doesn't exist
Stacktrace:
[1] CSV.Context(source::CSV.Arg, header::CSV.Arg, normalizenames::CSV.Arg, datarow::CSV.Arg, skipto::CSV.Arg, footerskip::CSV.Arg, transpose::CSV.Arg, comment::CSV.Arg, ignoreemptyrows::CSV.Arg, ignoreemptylines::CSV.Arg, select::CSV.Arg, drop::CSV.Arg, limit::CSV.Arg, buffer_in_memory::CSV.Arg, threaded::CSV.Arg, ntasks::CSV.Arg, tasks::CSV.Arg, rows_to_check::CSV.Arg, lines_to_check::CSV.Arg, missingstrings::CSV.Arg, missingstring::CSV.Arg, delim::CSV.Arg, ignorerepeated::CSV.Arg, quoted::CSV.Arg, quotechar::CSV.Arg, openquotechar::CSV.Arg, closequotechar::CSV.Arg, escapechar::CSV.Arg, dateformat::CSV.Arg, dateformats::CSV.Arg, decimal::CSV.Arg, groupmark::CSV.Arg, truestrings::CSV.Arg, falsestrings::CSV.Arg, stripwhitespace::CSV.Arg, type::CSV.Arg, types::CSV.Arg, typemap::CSV.Arg, pool::CSV.Arg, downcast::CSV.Arg, lazystrings::CSV.Arg, stringtype::CSV.Arg, strict::CSV.Arg, silencewarnings::CSV.Arg, maxwarnings::CSV.Arg, debug::CSV.Arg, parsingdebug::CSV.Arg, validate::CSV.Arg, streaming::CSV.Arg)
@ CSV C:\Users\denys\.julia\packages\CSV\OnldF\src\context.jl:314
[2] #File#32
@ C:\Users\denys\.julia\packages\CSV\OnldF\src\file.jl:222 [inlined]
[3] CSV.File(source::String)
@ CSV C:\Users\denys\.julia\packages\CSV\OnldF\src\file.jl:162
[4] read(source::String, sink::Type; copycols::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ CSV C:\Users\denys\.julia\packages\CSV\OnldF\src\CSV.jl:117
[5] read(source::String, sink::Type)
@ CSV C:\Users\denys\.julia\packages\CSV\OnldF\src\CSV.jl:113
[6] top-level scope
@ REPL[15]:1
So the file is valid but does not exist (it does). Anyways I would rather avoid mapping drives.
I tried GoogleDrive.jl, unfortunately I can’t get it to compile
julia> using GoogleDrive
[ Info: Precompiling GoogleDrive [91feb7a0-3508-11ea-1e8e-afea2c1c9a19]
ERROR: LoadError: ArgumentError: broadcasting over dictionaries and `NamedTuple`s is reserved
Stacktrace:
[1] broadcastable(#unused#::Base.EnvDict)
@ Base.Broadcast .\broadcast.jl:718
[2] broadcasted(f::Function, arg1::Base.EnvDict, arg2::Vector{String}, args::Vector{Vector{String}})
@ Base.Broadcast .\broadcast.jl:1314
[3] top-level scope
@ C:\Users\denys\.julia\packages\DataDeps\43qPc\src\locations.jl:8
[4] include(mod::Module, _path::String)
@ Base .\Base.jl:457
[5] include(x::String)
@ DataDeps C:\Users\denys\.julia\packages\DataDeps\43qPc\src\DataDeps.jl:2
[6] top-level scope
@ C:\Users\denys\.julia\packages\DataDeps\43qPc\src\DataDeps.jl:19
[7] include
@ .\Base.jl:457 [inlined]
[8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
@ Base .\loading.jl:2045
[9] top-level scope
@ stdin:3
in expression starting at C:\Users\denys\.julia\packages\DataDeps\43qPc\src\locations.jl:4
in expression starting at C:\Users\denys\.julia\packages\DataDeps\43qPc\src\DataDeps.jl:2
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile DataDeps [124859b0-ceae-595e-8997-d05f6a7a8dfe] to "C:\\Users\\denys\\.julia\\compiled\\v1.9\\DataDeps\\jl_346E.tmp".
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:2296
[3] compilecache
@ .\loading.jl:2163 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[9] include
@ .\Base.jl:457 [inlined]
[10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
@ Base .\loading.jl:2045
[11] top-level scope
@ stdin:3
in expression starting at C:\Users\denys\.julia\packages\GoogleDrive\Lg2PJ\src\GoogleDrive.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile GoogleDrive [91feb7a0-3508-11ea-1e8e-afea2c1c9a19] to "C:\\Users\\denys\\.julia\\compiled\\v1.9\\GoogleDrive\\jl_3367.tmp".
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:2296
[3] compilecache
@ .\loading.jl:2163 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
Given the poor documentation on GoogleDrive.jl I feel that it is not maintained.
Anyone has an alternative of a fix for this?
Thanks for your help.