Skip to content

Commit

Permalink
Fixes #408
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuernber committed May 17, 2024
1 parent b0896cc commit 24c0e64
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
# 7.030
* [issue-408](https://github.com/techascent/tech.ml.dataset/issues/408) - xlsx files with numberic column names now load.
* dtype-next upgrade fixing a few issues, most notably [issue-99](https://github.com/cnuernber/dtype-next/issues/99).

# 7.029
* large parquet files now load - slowly as loading can't be parallelized - without holding onto more memory than they should.

Expand Down
6 changes: 5 additions & 1 deletion src/tech/v3/dataset/io/context.clj
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@
colparser-compute-fn (reify Function
(apply [this col-idx]
(let [colname (col-idx->colname col-idx)
colname (if (empty? colname)
colname (cond
(number? colname)
colname
(empty? colname)
(make-colname col-idx)
:else
(utils/remove-zero-width-spaces colname))
colname (if (and ensure-unique-column-names?
(get colname->idx colname))
Expand Down
5 changes: 5 additions & 0 deletions test/tech/v3/libs/fastexcel_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,8 @@
(is (some? (ds/column ds "column::2")))
(is (some? (ds/column ds "column::4")))
(is (some? (ds/column ds "column-1::6"))))))


(deftest number-colname
(let [ds (ds/->dataset "test/data/number_column.xlsx")]
(is (= (first (ds/column-names ds)) 0.0))))

0 comments on commit 24c0e64

Please sign in to comment.