Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning/update swapped args #1336

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import re
import warnings
from typing import (
Any,
Callable,
Expand Down Expand Up @@ -1282,6 +1283,15 @@ def update(

.. versionadded:: 3.3
"""
if isinstance(range_name, (list, tuple)) and isinstance(values, str):
warnings.warn(
"The order of arguments in worksheet.update() has changed. "
"Please pass values first and range_name second"
"or used named arguments (range_name=, values=)",
DeprecationWarning,
)
range_name, values = values, range_name

full_range_name = absolute_range_name(self.title, range_name)

if not value_input_option:
Expand Down
Loading