Skip to content

Commit

Permalink
Add migration guide for method get_all_records
Browse files Browse the repository at this point in the history
Add the new section in the v6 migration guide about
the method `Worksheet.get_all_records` to allow users
to migrate from previous method signature to the new one.

closes #1376

Signed-off-by: Alexandre Lavigne <[email protected]>
  • Loading branch information
lavigne958 committed Jan 19, 2024
1 parent 3f5e483 commit 1075572
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,41 @@ file.sheet1.update_tab_color(tab_color)
+ age = spreadsheet.get_lastUpdateTime()
```

### Removed method `Worksheet.get_records`

The method `Worksheet.get_records()` has been removed.
The function `utils.to_records` has been added.

It takes hearder row, a matrix values and build the records from them.

### Simplify method `Worksheet.get_all_records`

v6 simplified the method `Worksheet.get_all_records`, it does not accept a bounded ranges of rows for
the values to fill the records. The below arguments have been remove from the method signature:

- first_index
- last_index

It now uses the function `utils.to_records`.

Update the method signature as follow:

```diff
get_all_records(
empty2zero=False,
head=1,
- first_index=None,
- last_index=None,
default_blank="",
allow_underscores_in_numeric_literals=False,
numericise_ignore=[],
value_render_option=None,
expected_headers=None,
)
```

In order to achieve the previous behavior one case use the new function `utils.to_records` by manually providing the headers and the values.

### Silence warnings

In version 5 there are many warnings to mark deprecated feature/functions/methods.
Expand Down

0 comments on commit 1075572

Please sign in to comment.