Skip to content

Commit

Permalink
Add combined_merged_cells to get()
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilman committed Feb 10, 2024
1 parent 475cb60 commit 9df2458
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions gspread_asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def __init__(self, agcm, ss: gspread.Spreadsheet):
self._ws_cache_idx: "Dict[int, AsyncioGspreadWorksheet]" = {}

def __repr__(self):
return "<{0} id:{1}>".format(self.__class__.__name__, self.ss.id)
return f"<{self.__class__.__name__} id:{self.ss.id}>"

def _wrap_ws(self, ws: gspread.Worksheet) -> "AsyncioGspreadWorksheet":
aws = AsyncioGspreadWorksheet(self.agcm, ws)
Expand Down Expand Up @@ -1093,7 +1093,7 @@ def __init__(self, agcm, ws: gspread.Worksheet):
self.ws = ws

def __repr__(self):
return "<{0} id:{1}>".format(self.__class__.__name__, self.ws.id)
return f"<{self.__class__.__name__} id:{self.ws.id}>"

async def acell(
self,
Expand Down Expand Up @@ -1873,6 +1873,7 @@ async def get(
major_dimension: str = None,
value_render_option: gspread.utils.ValueRenderOption = None,
date_time_render_option: gspread.utils.DateTimeOption = None,
combine_merged_cells: bool = False,
):
"""Reads values of a single range or a cell of a sheet.
Expand All @@ -1888,6 +1889,13 @@ async def get(
durations should be represented in the output. This is ignored if
``value_render_option`` is ``ValueRenderOption.formatted``. The default
``date_time_render_option`` is ``SERIAL_NUMBER``.
:param bool combine_merged_cells: (optional) If True, then all cells that
are part of a merged cell will have the same value as the top-left
cell of the merged cell. Defaults to False.
.. warning::
Setting this to True will cause an additional API request to be
made to retrieve the values of all merged cells.
:rtype: :class:`gspread.worksheet.ValueRange`
Expand All @@ -1913,6 +1921,7 @@ async def get(
major_dimension=major_dimension,
value_render_option=value_render_option,
date_time_render_option=date_time_render_option,
combine_merged_cells=combine_merged_cells,
)

async def get_all_records(
Expand Down Expand Up @@ -2011,7 +2020,7 @@ async def get_values(
major_dimension: str = None,
value_render_option: gspread.utils.ValueRenderOption = None,
date_time_render_option: gspread.utils.DateTimeOption = None,
combine_merged_cells: bool = False
combine_merged_cells: bool = False,
) -> List[List]:
"""Returns a list of lists containing all values from specified range.
By default values are returned as strings. See ``value_render_option``
Expand Down Expand Up @@ -2070,7 +2079,7 @@ async def get_values(
major_dimension=major_dimension,
value_render_option=value_render_option,
date_time_render_option=date_time_render_option,
combine_merged_cells=combine_merged_cells
combine_merged_cells=combine_merged_cells,
)

async def hide(self):
Expand Down

0 comments on commit 9df2458

Please sign in to comment.