Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some missing typing in code #1448

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions gspread/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def __init__(
) -> None:
self.http_client = http_client(auth, session)

def set_timeout(self, timeout: Optional[Union[float, Tuple[float, float]]] = None):
def set_timeout(
self, timeout: Optional[Union[float, Tuple[float, float]]] = None
) -> None:
"""How long to wait for the server to send
data before giving up, as a float, or a ``(connect timeout,
read timeout)`` tuple.
Expand Down Expand Up @@ -76,7 +78,7 @@ def list_spreadsheet_files(
return files

def _list_spreadsheet_files(
self, title=None, folder_id=None
self, title: Optional[str] = None, folder_id: Optional[str] = None
) -> Tuple[List[Dict[str, Any]], Response]:
files = []
page_token = ""
Expand Down Expand Up @@ -316,9 +318,9 @@ def copy(
continue

new_spreadsheet.share(
email_address=p["emailAddress"],
perm_type=p["type"],
role=p["role"],
email_address=str(p["emailAddress"]),
perm_type=str(p["type"]),
role=str(p["role"]),
alifeee marked this conversation as resolved.
Show resolved Hide resolved
notify=False,
)

Expand Down
4 changes: 3 additions & 1 deletion gspread/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ def spreadsheets_sheets_copy_to(
r = self.request("post", url, json=body)
return r.json()

def fetch_sheet_metadata(self, id: str, params: Optional[ParamsType] = None) -> Any:
def fetch_sheet_metadata(
self, id: str, params: Optional[ParamsType] = None
) -> Mapping[str, Any]:
"""Similar to :method spreadsheets_get:`gspread.http_client.spreadsheets_get`,
get the spreadsheet form the API but by default **does not get the cells data**.
It only retrieve the the metadata from the spreadsheet.
Expand Down
Loading