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

.xlsx loading fails if a column has a number for a name #408

Closed
kiramclean opened this issue May 7, 2024 · 2 comments
Closed

.xlsx loading fails if a column has a number for a name #408

kiramclean opened this issue May 7, 2024 · 2 comments

Comments

@kiramclean
Copy link

Loading an .xlsx spreadsheet fails if a column has a number for a name. For example this spreadsheed throws Don't know how to create ISeq from: java.lang.Double: example_XLSX.xlsx

@harold
Copy link
Contributor

harold commented May 7, 2024

Reproduced by downloading the file and...

user> (require '[tech.v3.dataset :as ds])
nil
user> (require '[tech.v3.libs.fastexcel])
Reflection warning, tech/v3/libs/fastexcel.clj:111:22 - reference to field getStableId on org.dhatim.fastexcel.reader.Sheet can't be resolved.
nil
user> (ds/->dataset "/home/harold/Downloads/example_XLSX.xlsx")
Execution error (IllegalArgumentException) at tech.v3.dataset.io.context$options$reify__31940/apply (context.clj:93).
Don't know how to create ISeq from: java.lang.Double

Suspicious:

colname (if (empty? colname)

Similar:

user> (empty? "foo")
false
user> (empty? 0)
Execution error (IllegalArgumentException) at user/eval59523 (form-init3289276633768178084.clj:26).
Don't know how to create ISeq from: java.lang.Long
user> (empty? 0.0)
Execution error (IllegalArgumentException) at user/eval59525 (form-init3289276633768178084.clj:29).
Don't know how to create ISeq from: java.lang.Double

Maybe if it's a number, call str on it? Hard to know what the cleanest fix might be. hth

@kiramclean
Copy link
Author

I assume you noticed already, but this is also the case for .xls files, e.g.
example_XLS.xls

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