Skip to content

Commit

Permalink
Merge pull request #992 from burnash/feature/prevent_insert_row_to_sh…
Browse files Browse the repository at this point in the history
…eet_with_colon

Feature/prevent insert row to sheet with colon
  • Loading branch information
lavigne958 committed Feb 20, 2022
2 parents cb580cf + 96ac895 commit effe1fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gspread/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def local_server_flow(client_config, scopes, port=0):
Creates an OAuth flow and runs `google_auth_oauthlib.flow.InstalledAppFlow.run_local_server <https://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_local_server>`_.
This will start a local web server and open the authorization URL in
the users browser.
the user's browser.
Pass this function to ``flow`` parameter of :meth:`~gspread.oauth` to run
a local server flow.
Expand Down Expand Up @@ -99,7 +99,7 @@ def oauth(
r"""Authenticate with OAuth Client ID.
By default this function will use the local server strategy and open
the authorization URL in the users browser::
the authorization URL in the user's browser::
gc = gspread.oauth()
Expand Down
8 changes: 8 additions & 0 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,14 @@ def insert_rows(self, values, row=1, value_input_option=ValueInputOption.raw):
or ``ValueInputOption.user_entered``.
See `ValueInputOption`_ in the Sheets API.
"""

# can't insert row on sheet with colon ':'
# in its name, see issue: https://issuetracker.google.com/issues/36761154
if ":" in self.title:
raise GSpreadException(
"can't insert row in worksheet with colon ':' in its name. See issue: https://issuetracker.google.com/issues/36761154"
)

body = {
"requests": [
{
Expand Down

0 comments on commit effe1fd

Please sign in to comment.