diff --git a/clients/python-wrapper/CHANGELOG.md b/clients/python-wrapper/CHANGELOG.md index a069ea3f5a8..bd0c59ce91a 100644 --- a/clients/python-wrapper/CHANGELOG.md +++ b/clients/python-wrapper/CHANGELOG.md @@ -5,7 +5,11 @@ ## v0.7.0 :new: What's new: -- AWS role Authentication: Initiate lakeFS Python client sessions securely using your AWS Role. (#7874) [Read more](https://docs.lakefs.io/reference/security/external-principals-aws.html#login-with-python) +- AWS role Authentication: Initiate lakeFS Python client sessions securely using your AWS Role. (#7874) [Read more](https://docs.lakefs.io/reference/security/external-principals-aws.html#login-with-python) + +:bug: Bugs fixed: + +- ObjectWriter write buffer as binary always (#7903) ## v0.6.2 diff --git a/clients/python-wrapper/lakefs/client.py b/clients/python-wrapper/lakefs/client.py index fef52b32eb9..87b562565a3 100644 --- a/clients/python-wrapper/lakefs/client.py +++ b/clients/python-wrapper/lakefs/client.py @@ -10,6 +10,7 @@ import json from threading import Lock from typing import Optional +from typing import TYPE_CHECKING from urllib.parse import urlparse, parse_qs import lakefs_sdk @@ -20,6 +21,9 @@ from lakefs.exceptions import NotAuthorizedException, ServerException, api_exception_handler from lakefs.models import ServerStorageConfiguration +if TYPE_CHECKING: + import boto3 + DEFAULT_REGION = 'us-east-1' @@ -131,7 +135,7 @@ def _extract_region_from_endpoint(endpoint): def _get_identity_token( - session: 'boto3.Session', + session: boto3.Session, lakefs_host: str, additional_headers: dict[str, str], presign_expiry @@ -208,7 +212,7 @@ def _get_identity_token( def from_aws_role( - session: 'boto3.Session', + session: boto3.Session, ttl_seconds: int = 3600, presigned_ttl: int = 60, additional_headers: dict[str, str] = None,