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

Very slow to retrieve only 1st row #386

Open
bricemaurin opened this issue Jan 1, 2021 · 0 comments
Open

Very slow to retrieve only 1st row #386

bricemaurin opened this issue Jan 1, 2021 · 0 comments

Comments

@bricemaurin
Copy link

bricemaurin commented Jan 1, 2021

Hi 👋
I'm trying to get the first row of each individual worksheet in a sheet.

My test file includes:

  • ws 1: 2501 rows, 11 cols
  • ws 2: 2446 rows, 29 cols

To load the header (1st row) of those 2 wsheets, it takes approx. 31 seconds.

Is there a method to specifically retrieve only the first row ? or ay other faster method ?

here's what i do right now:

@sheet = @session.spreadsheet_by_key(id)
@worksheets = @sheet.worksheets
data = []

@worksheets.each_with_index do |ws,i|
data << {
  title: ws.title,
  index: i,
  headers: ws.rows[0],
  num_rows: ws.num_rows,
  num_cols: ws.num_cols
}
end

Thanks in advance !

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

1 participant