From 76a93f7723e21ac43c08325889e9e83b3cadde0a Mon Sep 17 00:00:00 2001 From: Alexandre Lavigne Date: Sun, 21 Jan 2024 19:52:35 +0100 Subject: [PATCH] Add migration guide for get_all_records Signed-off-by: Alexandre Lavigne --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 30da3a803..d23a4e470 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,20 @@ file.sheet1.update_tab_color(tab_color) + age = spreadsheet.get_lastUpdateTime() ``` +### Replace method `Worksheet.get_records` + +In v6 you can now only get *all* sheet records, using `Worksheet.get_all_records()`. The method `Worksheet.get_records()` has been removed. You can get some records using your own fetches and combine them with `gspread.utils.to_records()`. + +```diff ++ from gspread import utils + all_records = spreadsheet.get_all_records(head=1) +- some_records = spreadsheet.get_all_records(head=1, first_index=6, last_index=9) +- some_records = spreadsheet.get_records(head=1, first_index=6, last_index=9) ++ header = spreadsheet.get("1:1")[0] ++ cells = spreadsheet.get("6:9") ++ some_records = utils.to_records(header, cells) +``` + ### Silence warnings In version 5 there are many warnings to mark deprecated feature/functions/methods.