Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguity with open(::Function, ::DataSet) #9

Open
mbauman opened this issue Mar 19, 2021 · 1 comment
Open

Ambiguity with open(::Function, ::DataSet) #9

mbauman opened this issue Mar 19, 2021 · 1 comment

Comments

@mbauman
Copy link
Member

mbauman commented Mar 19, 2021

julia> open(io->CSV.read(io, DataFrame), dataset("us_counties"))
ERROR: MethodError: open(::var"#13#14", ::DataSet) is ambiguous. Candidates:
  open(f::Function, args...; kwargs...) in Base at io.jl:322
  open(as_type, conf::DataSet) in DataSets at /home/jrun/data/.julia/packages/DataSets/ssxgC/src/DataSets.jl:278
Possible fix, define
  open(::Function, ::DataSet)
Stacktrace:
 [1] top-level scope at REPL[48]:1
@c42f
Copy link
Contributor

c42f commented Mar 23, 2021

Right, this version of open() isn't defined - instead, you can use open(func, T, dataset).

In your case open(io->CSV.read(io, DataFrame), IO, dataset("us_counties"))

Possibly we could define it; we'd need some concept of "default data type" T to open as and pass to the user's Function. For Blob that could be IO, but it could also be a data buffer like Vector{UInt8}. Or maybe it should just open as Blob to keep it lazy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants