CSV won't read after dependency issues

I just got into a bit of a dependency hell and ended up clearing and reinstalling many packages. Now, when I try to run programs that have worked before, I get an error when I try to read in my data. My code:

df = CSV.read(“MyPath/MyData.csv”)

The error throws at this line and says:

ERROR: LoadError: MethodError: promote_type2(::Type{Union{Missing, Int64}}, ::Type{Missing}) is ambiguous.

This looks like a missing values error, but this exact same data, full of missing values, used to read in fine. I’m at a loss and can do nothing until I’m able to read stuff in again. I am quite new to this, so hopefully I made an easy to correct mistake.
Thanks

Could you share the dataset (i.e., CSV file) for us to be able to replicate?

It is possible that your CSV.jl package is an older version now, that has some limitation or caveat.

Nothing has changed with the dataset, no alterations, etc. I’ve had this same error with CSV 0.3.0, 0.4.0, and 0.6.2.
I forgot to mention initially that this all started when I updated all my packages, that started the dependency issues. I kept chasing versions and got various errors. Finally I just wiped things and restarted. This exact error came up pre wipe with the older CSV versions and is continuing now.

I suppose you cannot share the CSV file as you ignored that request.

Also, you could help more by posting the whole error message here or in pastebin, instead of just the header.

If I remember correctly, the ambiguity error happens mostly when some package adds a new method for some existing function of another module, and calls that were previously resolved correctly by the dynamic dispatch become ambiguous. Can you test that line with only CSV imported? (and no other packages whatsoever)

I have a CSV file with missing columns here, and if I execute CSV.read (from CSV.jl version 0.6.2) it reads correctly. So I cannot reproduce your problem.

Yes this looks like an error caused by packages being out of sync somehow, you can try just adding CSV in a fresh environment without any other packages and see if that solves it.

I wonder if the Rust system can avoid this.

So, after starting everything up again this morning it works. It’s odd, I’ve changed nothing, but now it goes. Thank you for your suggestions. Pkg management is tricky.

Also, yes, I couldn’t share the csv as it contains lots of personal and employment info. Sorry for not mentioning that first time around.

1 Like

Perhaps you had Revise.jl running and it was interacting in an odd way? Sometimes that can happen.