Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
closes #1041
closes #1045
  • Loading branch information
lavigne958 committed Dec 16, 2022
1 parent 212f204 commit 402fc00
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 85 deletions.
24 changes: 0 additions & 24 deletions gspread/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,6 @@ def local_server_flow(client_config, scopes, port=0):
return flow.run_local_server(port=port)


def console_flow(client_config, scopes):
"""Run an OAuth flow using a console strategy.
Creates an OAuth flow and runs `google_auth_oauthlib.flow.InstalledAppFlow.run_console <https://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_console>`_.
Pass this function to ``flow`` parameter of :meth:`~gspread.oauth` to run
a console strategy.
"""
# The console flow has been disabled by google
# see: https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob
# now: warn the user about this
# next: remove this deprecated method
warnings.warn(
"The gspread.auth.console_flow flow won't succeed.\n"
"The OAuth out-of-band (OOB) flow is deprecated. "
"New clients will be unable to use this flow starting on Feb 28, 2022. "
"This flow will be deprecated for all clients on Oct 3, 2022. "
"Migrate to an alternative flow: gspread.auth.local_server_flow"
"see: https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob"
)
flow = InstalledAppFlow.from_client_config(client_config, scopes)
return flow.run_console()


def load_credentials(filename=DEFAULT_AUTHORIZED_USER_FILENAME):
if filename.exists():
return Credentials.from_authorized_user_file(filename)
Expand Down
15 changes: 0 additions & 15 deletions gspread/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,6 @@ def lastUpdateTime(self):
self._properties.update(metadata)
return self._properties["modifiedTime"]

@property
def updated(self):
""".. deprecated:: 2.0
This feature is not supported in Sheets API v4.
"""
import warnings

warnings.warn(
"Spreadsheet.updated() is deprecated, "
"this feature is not supported in Sheets API v4",
DeprecationWarning,
stacklevel=2,
)

@property
def timezone(self):
"""Spreadsheet timeZone"""
Expand Down
46 changes: 0 additions & 46 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,6 @@ def isSheetHidden(self):
# if the property is not set then hidden=False
return self._properties.get("hidden", False)

@property
def updated(self):
""".. deprecated:: 2.0
This feature is not supported in Sheets API v4.
"""
import warnings

warnings.warn(
"Worksheet.updated() is deprecated, "
"this feature is not supported in Sheets API v4",
DeprecationWarning,
stacklevel=2,
)

@property
def row_count(self):
"""Number of rows."""
Expand Down Expand Up @@ -1796,23 +1781,6 @@ def insert_cols(

return self.spreadsheet.values_append(range_label, params, body)

def delete_row(self, index):
""".. deprecated:: 5.0
Deletes the row from the worksheet at the specified index.
:param int index: Index of a row for deletion.
"""
import warnings

warnings.warn(
"Worksheet.delete_row() is deprecated, "
"Please use `Worksheet.delete_rows()` instead.",
DeprecationWarning,
stacklevel=2,
)
return self.delete_rows(index)

@cast_to_a1_notation
def add_protected_range(
self,
Expand Down Expand Up @@ -2157,20 +2125,6 @@ def clear_basic_filter(self):

return self.spreadsheet.batch_update(body)

def export(self, format):
""".. deprecated:: 2.0
This feature is not supported in Sheets API v4.
"""
import warnings

warnings.warn(
"Worksheet.export() is deprecated, "
"this feature is not supported in Sheets API v4",
DeprecationWarning,
stacklevel=2,
)

def duplicate(
self, insert_sheet_index=None, new_sheet_id=None, new_sheet_name=None
):
Expand Down

0 comments on commit 402fc00

Please sign in to comment.