Skip to content

Commit

Permalink
Added a column headers property and getters [Issue burnash#677]
Browse files Browse the repository at this point in the history
  • Loading branch information
muddi900 committed Nov 27, 2024
1 parent 94617c9 commit cef9fb3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,17 @@ def __init__(
# kept for backward compatibility - publicly available
# do not use if possible.
self._spreadsheet = spreadsheet
self._column_headers = []

@property
def column_headers(self) -> List[str]:
if not self._column_headers:
self._column_headers = self.row_values(1)
return self._column_headers

@column_headers.setter
def column_headers(self, value: List[str]) -> None:
self._column_headers = value

def __repr__(self) -> str:
return "<{} {} id:{}>".format(
Expand Down

0 comments on commit cef9fb3

Please sign in to comment.