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

What is the correct parameter behaviors? #11

Closed
velios opened this issue Nov 15, 2023 · 2 comments
Closed

What is the correct parameter behaviors? #11

velios opened this issue Nov 15, 2023 · 2 comments

Comments

@velios
Copy link
Contributor

velios commented Nov 15, 2023

Let's look at the following example

(get-sheet (io/file "/Users/flocktory/Code/bb-excel/test/data/simple.xlsx") 1)
=>
({:_r 1, :A "FirstName", :B "LastName", :C "DateOfBirth", :D "Show", :E "Votes"}
 {:_r 2, :A "Jack", :B "Bean", :C "04/20/1979", :D "Breaking Bad", :E "1325"}
 {:_r 3, :A "Mary", :B "Smith", :C "05/15/1991", :D "House M.D", :E "435"}
 {:_r 4, :A "Todd", :B "Green", :C "12/31/1999", :D "La Femme Nikita", :E "80"})

This is data from example table without opts. Let's set start-row(row) to 3 and rename columns with data from the first row

(get-sheet (io/file "/Users/flocktory/Code/bb-excel/test/data/simple.xlsx") 1 {:row 3 :hdr true})
=>
({:_r 1, "Mary" "FirstName", "Smith" "LastName", "05/15/1991" "DateOfBirth", "House M.D" "Show", "435" "Votes"}
 {:_r 2, "Mary" "Jack", "Smith" "Bean", "05/15/1991" "04/20/1979", "House M.D" "Breaking Bad", "435" "1325"}
 {:_r 4, "Mary" "Todd", "Smith" "Green", "05/15/1991" "12/31/1999", "House M.D" "La Femme Nikita", "435" "80"})

Some questions about happen above?

  1. Are the headlines we received correct? We started from the third line. Did we want to get its values as headers? Or would we like to get the values from the first row as headers? Or would we like to control this behavior through a parameter? Like :hdr :top-sheet-row || :top-range-row || :numeric-representation ;; or maybe even numeric, like we can do in excel itself
  2. Here I’m almost sure that we are dealing with unexpected behavior, but I’ll still clarify whether this is so. Should we have gotten lines 1 and 2 in the example above? Or if the first line is line 3, then then we only deal with lines 3 and above? An exception is possible in the form of taking the value for the header from the first row in the sheet.
  3. Is it really necessary to limit the :rows(Number of rows to extract) parameter to 10000 values? Maybe change it to 1048576 which represent maximum row count xlsx format supported? When I first encountered that I only got 10,000 records, it was unexpected for me.
  4. If the :row parameter was specified, were :rows meant to be counted from :row or from the top row in the table?
@velios
Copy link
Contributor Author

velios commented Nov 18, 2023

@kbosompem can you comment pls?

@kbosompem
Copy link
Owner

kbosompem commented Dec 2, 2023

@velios looks like we have a bug. Please see responses below
#2 if you specify :hdr and row 3 the expectation is that the table begins on row 3 and row 3 has the headers for the table.
#3 agreed
#4 horrible naming on my part but what i intended for row and rows should have been row-start and row-end respectively.

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