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.

Allow `get_all_records()` function to pass `value_render_option` parameter)

See original GitHub issue

I would like to fetch data from a worksheet using get_all_records() function. The kind of data in the worksheet (dates & precise float numbers) forces me to use the following requests params in order to get the data regardless of the formating:

{'valueRenderOption': "UNFORMATTED_VALUE"}

I would like to have at least value_render_option parameter in the function get_all_records(). All the data should be then fetched with the render option passed by that parameter. In my specific case i would just call:

my_worksheet.get_all_records(default_blank=None, value_render_option= "FORMATTED_VALUE")

The tricky part is what should happen with the “head” row - and therefore the keys of the dictionaries returned by get_all_records() function. I have no strong preference here, the keys could be fetched using the value_render_option.

Of course, there are alternative solutions to the issue as there are other functions that provide value_render_option parameter. The whole issue is more about convenience and consistency.

The fix for that issue is not that obvious as just passing a parameter as numericise function needs to be reconsidered in case of new types of data returned from the worksheet.

I will be happy to help with the issue. I can write the patch and create a PR, please just give me a green light (especially with the special treating of the “head” row).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
burnashcommented, Jun 9, 2020

Thank you for the PR. Your point regarding accepted_kwargs is very convincing. I agree it does not really fit the case for get_all_records.

0reactions
lavigne958commented, Nov 28, 2021

this is been merged.

closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueRenderOption | Google Sheets
Determines how values should be rendered in the output. Values will be calculated & formatted in the reply according to the cell's formatting....
Read more >
pygsheets get_all_records value_render = FORMULA is ...
Source data looks like this where cell B2 is =A2*3. Number Formula 11.5 34.5. When I use get_all_values method, I get the correct...
Read more >
How to use the pygsheets.custom_types.ValueRenderOption ...
How to use the pygsheets.custom_types.ValueRenderOption.FORMATTED_VALUE function in pygsheets. To help you get started, we've selected a few pygsheets ...
Read more >
gspread Documentation - Read the Docs
Enable API Access for a Project if you haven't done it yet. ... Pass this function to flow parameter of oauth() to run...
Read more >
Create & use named functions - Google Docs Editors Help
Named functions let you create custom functions that can use built-in ... “ value_if_true ” or “ value_if_false " as arguments into a...
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