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 authored Jul 17, 2024
1 parent 9374013 commit 4dca2b5
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 @@ -197,6 +197,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 4dca2b5

Please sign in to comment.