Skip to content

Commit

Permalink
add deprecation warnings for lastUpdateTime...
Browse files Browse the repository at this point in the history
and refresh_lastUpdateTime
  • Loading branch information
alifeee committed Oct 25, 2023
1 parent f6d1b1b commit 82e593b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions gspread/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
SPREADSHEET_VALUES_CLEAR_URL,
SPREADSHEET_VALUES_URL,
)
from .utils import ExportFormat, finditem, quote
from .utils import ExportFormat, deprecation_warning, finditem, quote
from .worksheet import Worksheet


Expand Down Expand Up @@ -64,11 +64,9 @@ def lastUpdateTime(self):
"""Spreadsheet last updated time.
Only updated on initialisation.
For actual last updated time, use get_lastUpdateTime()."""
warnings.warn(
"""
This is only updated on initialisation and is probably outdated by the time you use it.
For an up to date last updated time, use get_lastUpdateTime().
"""
deprecation_warning(
version="6.0.0",
msg="lastUpdateTime will be removed. Please use get_lastUpdateTime()",
)
if "modifiedTime" not in self._properties:
self.update_drive_metadata()
Expand Down Expand Up @@ -759,6 +757,10 @@ def list_protected_ranges(self, sheetid):
def refresh_lastUpdateTime(self) -> None:
"""Updates the cached value of lastUpdateTime."""
# remove this and the below upon deprecation of lastUpdateTime @property
deprecation_warning(
version="6.0.0",
msg="refresh_lastUpdateTime will be removed. Please use get_lastUpdateTime()",
)
self._properties["modifiedTime"] = self.get_lastUpdateTime()

def get_lastUpdateTime(self) -> str:
Expand Down

0 comments on commit 82e593b

Please sign in to comment.