question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Suggestion] Multi-Row Append Function

See original GitHub issue

The current append_row function actually works for multiple rows if the square brackets in values: [values] are removed.

So if you copy-paste the function, remove the brackets, and call it ‘append_rows’, it now submits as many new rows to a sheet as you like.

e.g.

def append_rows(self, values, value_input_option='RAW'):
        """Adds multiple rows to the worksheet with values populated.
        The input should be a list of lists, with the lists each
        containing one row's values.
        Widens the worksheet if there are more values than columns.
        :param values: List of row lists.
        """
        params = {
                'valueInputOption': value_input_option
        }

        body = {
                'majorDimension': 'ROWS',
                'values': values
        }

        return self.spreadsheet.values_append(self.title, params, body)

Note that the majorDimension key isn’t necessary, but makes it explicit instead of relying on gsheets to figure out it’s not columns.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

1reaction
Tethikcommented, Oct 4, 2018

I would like to see this too. I hit the rate limit pretty quickly without this functionality. Using the above function worked perfect for my use case (~20k rows).

0reactions
emlazzarincommented, Aug 26, 2019

@burnash is completely off the grid and seems to have abandoned this project entirely. I’ve asked him if he could give some people permission to merge PRs, but he hasn’t responded.

This is one of the biggest issues with these kinds of projects: a single maintainer becomes the single point of failure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for multi row INSERT
For quick multi row INSERTs (bulk inserts), it would be very useful to be able to supply multiple rows to the VALUES() constructor...
Read more >
Add support for multi-row INSERT statements · Issue #455
+1 This feature would help when implementing Extract, Transform, Load jobs of millions of records where "INSERT INTO counters" adds a bit of ......
Read more >
Append enabled multiline column is not getting exported
To export the appended column values (Multiline text column) completely, you can try the method As Maruthu suggested.
Read more >
5 Tricks to Master Pandas append() | by B. Chen
5 Tricks to Master Pandas append() · 1. Appending a single row · 2. Appending multiple rows · 3. When column names don't...
Read more >
How to Insert Multiple Rows in Excel? The 4 Best Methods
The best way to fastly add multiple rows is to use keyboard shortcuts. They are: Step 1: Click and Select the Row cells...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found