Skip to content

Commit 1567dca

Browse files
committed
lint changes
1 parent 1994d14 commit 1567dca

File tree

4 files changed

+59
-48
lines changed

4 files changed

+59
-48
lines changed

poetry.lock

Lines changed: 28 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyiceberg/catalog/rest/auth.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
import base64
1919
import importlib
20-
from abc import ABC, abstractmethod
2120
import logging
21+
from abc import ABC, abstractmethod
2222
from typing import Any, Dict, List, Optional, Type
2323

2424
from requests import HTTPError, PreparedRequest, Session
@@ -121,9 +121,7 @@ def auth_header(self) -> str:
121121

122122

123123
class GoogleAuthManager(AuthManager):
124-
"""
125-
An auth manager that is responsible for handling Google credentials.
126-
"""
124+
"""An auth manager that is responsible for handling Google credentials."""
127125

128126
def __init__(self, credentials_path: Optional[str] = None, scopes: Optional[List[str]] = None):
129127
"""
@@ -137,9 +135,7 @@ def __init__(self, credentials_path: Optional[str] = None, scopes: Optional[List
137135
import google.auth
138136
import google.auth.transport.requests
139137
except ImportError as e:
140-
raise ImportError(
141-
"Google Auth libraries not found. Please install 'google-auth'."
142-
) from e
138+
raise ImportError("Google Auth libraries not found. Please install 'google-auth'.") from e
143139

144140
if credentials_path:
145141
self.credentials, _ = google.auth.load_credentials_from_file(credentials_path, scopes=scopes)
@@ -152,6 +148,7 @@ def auth_header(self) -> Optional[str]:
152148
self.credentials.refresh(self._auth_request)
153149
return f"Bearer {self.credentials.token}"
154150

151+
155152
class AuthManagerAdapter(AuthBase):
156153
"""A `requests.auth.AuthBase` adapter that integrates an `AuthManager` into a `requests.Session` to automatically attach the appropriate Authorization header to every request.
157154

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ zstandard = ">=0.13.0,<1.0.0"
6363
tenacity = ">=8.2.3,<10.0.0"
6464
pyroaring = ">=1.0.0,<2.0.0"
6565
pyarrow = { version = ">=17.0.0,<21.0.0", optional = true }
66+
google-auth = { version = ">=2.4.0", optional = true }
6667
pandas = { version = ">=1.0.0,<3.0.0", optional = true }
6768
duckdb = { version = ">=0.5.0,<2.0.0", optional = true }
6869
ray = [
@@ -127,6 +128,10 @@ ignore_missing_imports = true
127128
module = "pyarrow.*"
128129
ignore_missing_imports = true
129130

131+
[[tool.mypy.overrides]]
132+
module = "google.*"
133+
ignore_missing_imports = true
134+
130135
[[tool.mypy.overrides]]
131136
module = "pandas.*"
132137
ignore_missing_imports = true
@@ -317,6 +322,7 @@ rest-sigv4 = ["boto3"]
317322
hf = ["huggingface-hub"]
318323
pyiceberg-core = ["pyiceberg-core"]
319324
datafusion = ["datafusion"]
325+
gcp-auth=["google-auth"]
320326

321327
[tool.pytest.ini_options]
322328
testpaths = ["tests"]

0 commit comments

Comments
 (0)