Skip to content

Commit

Permalink
Merge pull request #1381 from burnash/feature/merge_master_into_relea…
Browse files Browse the repository at this point in the history
…se_6_0_0

feature/merge master into release 6 0 0
  • Loading branch information
lavigne958 committed Jan 27, 2024
2 parents 406e0a1 + 07ab681 commit 2c4d117
Show file tree
Hide file tree
Showing 5 changed files with 1,291 additions and 5 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release History
===============

5.12.4.(2023-12-31)
-------------------

* Bump actions/setup-python from 4 to 5 by @dependabot in https://github.com/burnash/gspread/pull/1370
* Fixed default value of merge_type parameter in merge_cells function docstring. by @neolooong in https://github.com/burnash/gspread/pull/1373

5.12.3 (2023-12-15)
-------------------

Expand Down
9 changes: 9 additions & 0 deletions gspread/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ class Dimension(StrEnum):
cols = "COLUMNS"


class MergeType(StrEnum):
merge_all = "MERGE_ALL"
merge_columns = "MERGE_COLUMNS"
merge_rows = "MERGE_ROWS"


SILENCE_WARNINGS_ENV_KEY = "GSPREAD_SILENCE_WARNINGS"


class ValueRenderOption(StrEnum):
formatted = "FORMATTED_VALUE"
unformatted = "UNFORMATTED_VALUE"
Expand Down
11 changes: 6 additions & 5 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
Dimension,
GridRangeType,
InsertDataOption,
MergeType,
PasteOrientation,
PasteType,
T,
Expand Down Expand Up @@ -2492,14 +2493,14 @@ def copy_to(
)

@cast_to_a1_notation
def merge_cells(self, name: str, merge_type: str = "MERGE_ALL") -> JSONResponse:
"""Merge cells. There are 3 merge types: ``MERGE_ALL``, ``MERGE_COLUMNS``,
and ``MERGE_ROWS``.
def merge_cells(self, name: str, merge_type: str = MergeType.merge_all):
"""Merge cells.
:param str name: Range name in A1 notation, e.g. 'A1:A5'.
:param str merge_type: (optional) one of ``MERGE_ALL``,
``MERGE_COLUMNS``, or ``MERGE_ROWS``. Defaults to ``MERGE_ROWS``.
:param merge_type: (optional) one of ``MergeType.merge_all``,
``MergeType.merge_columns``, or ``MergeType.merge_rows``. Defaults to ``MergeType.merge_all``.
See `MergeType`_ in the Sheets API reference.
:type merge_type: :namedtuple:`~gspread.utils.MergeType`
Alternatively, you may specify numeric boundaries. All values
index from 1 (one):
Expand Down
Loading

0 comments on commit 2c4d117

Please sign in to comment.