Skip to content

Commit 37c52ee

Browse files
Gayathri Srividya RajavarapuGayathri Srividya Rajavarapu
authored andcommitted
fix: resolve mypy lint errors for AuthManagerFactory and test type annotations
1 parent 441a18d commit 37c52ee

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

pyiceberg/catalog/rest/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def _create_session(self) -> Session:
486486
raise ValueError(
487487
f"auth.impl can only be specified when using custom auth.type{f' (from {source_env_var})' if source_env_var else ''}"
488488
)
489-
self._auth_manager = AuthManagerFactory.create(auth_impl or auth_type, auth_type_config)
489+
self._auth_manager = AuthManagerFactory.create(auth_impl or auth_type, auth_type_config or {})
490490
session.auth = AuthManagerAdapter(self._auth_manager)
491491
else:
492492
self._auth_manager = self._create_legacy_oauth2_auth_manager(session)

tests/catalog/test_rest.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,13 @@ def test_load_table_without_storage_credentials(
32123212
),
32133213
],
32143214
)
3215-
def test_rest_catalog_with_auth_json_string(requests_mock, rest_mock, auth_dict, expected_header, mocker_type):
3215+
def test_rest_catalog_with_auth_json_string(
3216+
requests_mock: Any,
3217+
rest_mock: Any,
3218+
auth_dict: dict[str, Any],
3219+
expected_header: Any,
3220+
mocker_type: str,
3221+
) -> None:
32163222
"""Test various auth configs as JSON string (from env var) are decoded and handled correctly."""
32173223
if mocker_type == "rest_mock":
32183224
rest_mock.get(
@@ -3344,8 +3350,12 @@ def test_rest_catalog_with_basic_auth_flat_properties(rest_mock: Mocker) -> None
33443350
],
33453351
)
33463352
def test_rest_catalog_with_flat_properties_edge_cases(
3347-
requests_mock, rest_mock, catalog_properties, token_response, expected_scopes
3348-
):
3353+
requests_mock: Any,
3354+
rest_mock: Any,
3355+
catalog_properties: dict[str, Any],
3356+
token_response: dict[str, Any] | None,
3357+
expected_scopes: str | list[str],
3358+
) -> None:
33493359
"""Test flat property env-var style for OAuth2, Google, Entra with list[str] scopes and edge cases."""
33503360
if catalog_properties["auth.type"] == "oauth2":
33513361
requests_mock.post(

0 commit comments

Comments
 (0)