Skip to content

Commit

Permalink
Merge pull request #1295 from burnash/deprecation/remove-lastUpdateTime
Browse files Browse the repository at this point in the history
remove lastUpdateTime
  • Loading branch information
alifeee authored Sep 11, 2023
2 parents 608789f + c09ec58 commit 15f5d6e
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions gspread/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""

import warnings
from typing import Union

from .exceptions import WorksheetNotFound
Expand Down Expand Up @@ -48,19 +47,6 @@ def creationTime(self):
"""Spreadsheet Creation time."""
return self._properties["createdTime"]

@property
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().
"""
)
return self._properties["modifiedTime"]

@property
def timezone(self):
"""Spreadsheet timeZone"""
Expand Down Expand Up @@ -709,16 +695,7 @@ def list_protected_ranges(self, sheetid):

return sheet.get("protectedRanges", [])

def refresh_lastUpdateTime(self) -> None:
"""Updates the cached value of lastUpdateTime."""
# remove this and the below upon deprecation of lastUpdateTime @property
self._properties["modifiedTime"] = self.get_lastUpdateTime()

def get_lastUpdateTime(self) -> str:
"""Get the lastUpdateTime metadata from the Drive API.
Also updates the cached value in the _properties dict.
"""
"""Get the lastUpdateTime metadata from the Drive API."""
metadata = self.client.get_file_drive_metadata(self.id)
# remove next line and the above upon deprecation of lastUpdateTime @property
self._properties["modifiedTime"] = metadata["modifiedTime"]
return metadata["modifiedTime"]

0 comments on commit 15f5d6e

Please sign in to comment.