From 13869e6630b8ce19705439f4912e5849ec153ca3 Mon Sep 17 00:00:00 2001 From: Nir Ozery Date: Tue, 5 Dec 2023 20:51:32 +0000 Subject: [PATCH] CF Fixes --- clients/python-wrapper/lakefs/import_manager.py | 5 +++-- clients/python-wrapper/lakefs/models.py | 2 +- clients/python-wrapper/lakefs/reference.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/clients/python-wrapper/lakefs/import_manager.py b/clients/python-wrapper/lakefs/import_manager.py index 16a3a2d81c2..e543cb7fdee 100644 --- a/clients/python-wrapper/lakefs/import_manager.py +++ b/clients/python-wrapper/lakefs/import_manager.py @@ -10,7 +10,7 @@ import lakefs_sdk -from lakefs.models import ImportStatus, _OBJECT, _PREFIX +from lakefs.models import ImportStatus, _OBJECT, _COMMON_PREFIX from lakefs.client import Client, DEFAULT_CLIENT from lakefs.exceptions import ImportManagerException, api_exception_handler @@ -54,7 +54,8 @@ def prefix(self, object_store_uri: str, destination: str) -> ImportManager: :param destination: The destination prefix relative to the branch :return: The ImportManager instance (self) after update, to allow operations chaining """ - self.sources.append(lakefs_sdk.ImportLocation(type=_PREFIX, path=object_store_uri, destination=destination)) + self.sources.append( + lakefs_sdk.ImportLocation(type=_COMMON_PREFIX, path=object_store_uri, destination=destination)) return self def object(self, object_store_uri: str, destination: str) -> ImportManager: diff --git a/clients/python-wrapper/lakefs/models.py b/clients/python-wrapper/lakefs/models.py index 3936aeac67f..40a1f06345c 100644 --- a/clients/python-wrapper/lakefs/models.py +++ b/clients/python-wrapper/lakefs/models.py @@ -9,7 +9,7 @@ from lakefs.namedtuple import LenientNamedTuple -_PREFIX = "common_prefix" +_COMMON_PREFIX = "common_prefix" _OBJECT = "object" diff --git a/clients/python-wrapper/lakefs/reference.py b/clients/python-wrapper/lakefs/reference.py index 23b2342cb5a..79d8aa504bc 100644 --- a/clients/python-wrapper/lakefs/reference.py +++ b/clients/python-wrapper/lakefs/reference.py @@ -49,7 +49,8 @@ def objects(self, delimiter: Optional[str] = None, **kwargs) -> Generator[StoredObject | CommonPrefix]: """ - Returns an object generator for this reference + Returns an object generator for this reference, the generator can yield either a StoredObject or a CommonPrefix + object depending on the listing parameters provided. :param max_amount: Stop showing changes after this amount :param after: Return items after this value