Allow `get_all_records()` function to pass `value_render_option` parameter)
See original GitHub issueI 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:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Thank you for the PR. Your point regarding
accepted_kwargs
is very convincing. I agree it does not really fit the case forget_all_records
.this is been merged.
closing this issue.