atlan-application-sdk 1.1.0__py3-none-any.whl → 1.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- application_sdk/outputs/__init__.py +8 -0
- application_sdk/services/objectstore.py +30 -7
- application_sdk/version.py +1 -1
- {atlan_application_sdk-1.1.0.dist-info → atlan_application_sdk-1.1.1.dist-info}/METADATA +1 -1
- {atlan_application_sdk-1.1.0.dist-info → atlan_application_sdk-1.1.1.dist-info}/RECORD +8 -8
- {atlan_application_sdk-1.1.0.dist-info → atlan_application_sdk-1.1.1.dist-info}/WHEEL +0 -0
- {atlan_application_sdk-1.1.0.dist-info → atlan_application_sdk-1.1.1.dist-info}/licenses/LICENSE +0 -0
- {atlan_application_sdk-1.1.0.dist-info → atlan_application_sdk-1.1.1.dist-info}/licenses/NOTICE +0 -0
|
@@ -27,6 +27,7 @@ from temporalio import activity
|
|
|
27
27
|
from application_sdk.activities.common.models import ActivityStatistics
|
|
28
28
|
from application_sdk.activities.common.utils import get_object_store_prefix
|
|
29
29
|
from application_sdk.common.dataframe_utils import is_empty_dataframe
|
|
30
|
+
from application_sdk.constants import ENABLE_ATLAN_UPLOAD, UPSTREAM_OBJECT_STORE_NAME
|
|
30
31
|
from application_sdk.observability.logger_adaptor import get_logger
|
|
31
32
|
from application_sdk.observability.metrics_adaptor import MetricType
|
|
32
33
|
from application_sdk.services.objectstore import ObjectStore
|
|
@@ -344,6 +345,13 @@ class Output(ABC):
|
|
|
344
345
|
|
|
345
346
|
async def _upload_file(self, file_name: str):
|
|
346
347
|
"""Upload a file to the object store."""
|
|
348
|
+
if ENABLE_ATLAN_UPLOAD:
|
|
349
|
+
await ObjectStore.upload_file(
|
|
350
|
+
source=file_name,
|
|
351
|
+
store_name=UPSTREAM_OBJECT_STORE_NAME,
|
|
352
|
+
retain_local_copy=True,
|
|
353
|
+
destination=get_object_store_prefix(file_name),
|
|
354
|
+
)
|
|
347
355
|
await ObjectStore.upload_file(
|
|
348
356
|
source=file_name,
|
|
349
357
|
destination=get_object_store_prefix(file_name),
|
|
@@ -28,6 +28,21 @@ class ObjectStore:
|
|
|
28
28
|
OBJECT_LIST_OPERATION = "list"
|
|
29
29
|
OBJECT_DELETE_OPERATION = "delete"
|
|
30
30
|
|
|
31
|
+
@staticmethod
|
|
32
|
+
def _normalize_object_store_key(path: str) -> str:
|
|
33
|
+
"""Normalize a path to use forward slashes for object store keys.
|
|
34
|
+
|
|
35
|
+
Object store keys (S3, Azure Blob, GCS, local file bindings) always use
|
|
36
|
+
forward slashes as the path separator regardless of the operating system.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
path: The path to normalize.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
The normalized path (forward slashes) for object store keys.
|
|
43
|
+
"""
|
|
44
|
+
return path.replace(os.sep, "/")
|
|
45
|
+
|
|
31
46
|
@classmethod
|
|
32
47
|
def _create_file_metadata(cls, key: str) -> dict[str, str]:
|
|
33
48
|
"""Create metadata for file operations (get, delete, create).
|
|
@@ -101,18 +116,26 @@ class ObjectStore:
|
|
|
101
116
|
else:
|
|
102
117
|
return []
|
|
103
118
|
|
|
119
|
+
# Normalize prefix for cross-platform path comparison
|
|
120
|
+
normalized_prefix = (
|
|
121
|
+
cls._normalize_object_store_key(prefix) if prefix else ""
|
|
122
|
+
)
|
|
123
|
+
|
|
104
124
|
valid_list = []
|
|
105
125
|
for path in paths:
|
|
106
126
|
if not isinstance(path, str):
|
|
107
127
|
logger.warning(f"Skipping non-string path: {path}")
|
|
108
128
|
continue
|
|
109
129
|
|
|
130
|
+
# Normalize path separators for cross-platform compatibility
|
|
131
|
+
normalized_path = cls._normalize_object_store_key(path)
|
|
132
|
+
|
|
110
133
|
valid_list.append(
|
|
111
|
-
|
|
112
|
-
if
|
|
113
|
-
else os.path.basename(
|
|
114
|
-
if
|
|
115
|
-
else
|
|
134
|
+
normalized_path[normalized_path.find(normalized_prefix) :]
|
|
135
|
+
if normalized_prefix and normalized_prefix in normalized_path
|
|
136
|
+
else os.path.basename(normalized_path)
|
|
137
|
+
if normalized_prefix
|
|
138
|
+
else normalized_path
|
|
116
139
|
)
|
|
117
140
|
|
|
118
141
|
return valid_list
|
|
@@ -357,8 +380,8 @@ class ObjectStore:
|
|
|
357
380
|
# Calculate relative path from the base directory
|
|
358
381
|
relative_path = os.path.relpath(file_path, source)
|
|
359
382
|
# Create store key by combining prefix with relative path
|
|
360
|
-
store_key =
|
|
361
|
-
os.
|
|
383
|
+
store_key = cls._normalize_object_store_key(
|
|
384
|
+
os.path.join(destination, relative_path)
|
|
362
385
|
)
|
|
363
386
|
await cls.upload_file(
|
|
364
387
|
file_path, store_key, store_name, retain_local_copy
|
application_sdk/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atlan-application-sdk
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Atlan Application SDK is a Python library for developing applications on the Atlan Platform
|
|
5
5
|
Project-URL: Repository, https://github.com/atlanhq/application-sdk
|
|
6
6
|
Project-URL: Documentation, https://github.com/atlanhq/application-sdk/README.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
application_sdk/__init__.py,sha256=2e2mvmLJ5dxmJGPELtb33xwP-j6JMdoIuqKycEn7hjg,151
|
|
2
2
|
application_sdk/constants.py,sha256=S3I_WUGFbmAPH5GTtoTKD5rxILGevkZ219zhctLQles,11568
|
|
3
|
-
application_sdk/version.py,sha256=
|
|
3
|
+
application_sdk/version.py,sha256=opHWQY85RSWj9KfIeTcFYuFmG4PtLAInuZmCX2GGbZc,84
|
|
4
4
|
application_sdk/worker.py,sha256=D3-wtfGv1DLFKi1YSaE3jTcX66eC00N6RwtBu9RkgNc,7555
|
|
5
5
|
application_sdk/activities/__init__.py,sha256=6SiefuOPUDGfN3z6oPY4RkQLiUmkHpoDy5xadzpDzAw,11588
|
|
6
6
|
application_sdk/activities/lock_management.py,sha256=6Wdf3jMKitoarHQP91PIJOoGFz4aaOLS_40c7n1yAOA,3902
|
|
@@ -79,7 +79,7 @@ application_sdk/observability/observability.py,sha256=MGxNFPx6pOdpWrpNXZp44NPk3S
|
|
|
79
79
|
application_sdk/observability/traces_adaptor.py,sha256=0eQJPN-tYA_dV8D3uEa5ZiX9g12NDuLnPaFuQMVDdL0,18242
|
|
80
80
|
application_sdk/observability/utils.py,sha256=-02GAFom8Bg4SNyCTNYySmen2dzvLfTu43bqsNq1AH0,3096
|
|
81
81
|
application_sdk/observability/decorators/observability_decorator.py,sha256=yd6qfrg1MmH5KcZ5Ydzb0RaBzmxx5FrmiI9qwvZx3EU,8963
|
|
82
|
-
application_sdk/outputs/__init__.py,sha256=
|
|
82
|
+
application_sdk/outputs/__init__.py,sha256=PRBc0UEyLzNfuKDRstCdI--6tWe4TUxpW_par9tWyiU,17204
|
|
83
83
|
application_sdk/outputs/iceberg.py,sha256=TdppOMEMfojMhGyBmhWeu1AJQexRyHM-huAYeJmhjdY,5533
|
|
84
84
|
application_sdk/outputs/json.py,sha256=gYDDNOVb8EFxxeOkb6zKWZWjTEVgZLoapFM97_roK4A,10883
|
|
85
85
|
application_sdk/outputs/parquet.py,sha256=DxcKh1IXPdiXNQJS1HIn6-JRdLkmN4At8uF1zppiZX0,20762
|
|
@@ -99,7 +99,7 @@ application_sdk/server/mcp/server.py,sha256=HG8tFmcc-f9Wj3vZzs2oRoNJzN1s5hwjnKyk
|
|
|
99
99
|
application_sdk/services/__init__.py,sha256=H-5HZEPdr53MUfAggyHqHhRXDRLZFZsxvJgWbr257Ds,465
|
|
100
100
|
application_sdk/services/atlan_storage.py,sha256=TKzXxu0yXeUcmZehwp8PcnQTC4A9w9RlZ0Fl-Xp1bLE,8509
|
|
101
101
|
application_sdk/services/eventstore.py,sha256=X03JzodKByXh8w8nOl658rnnZfMFTj0IkmiLVbd6IN8,6729
|
|
102
|
-
application_sdk/services/objectstore.py,sha256=
|
|
102
|
+
application_sdk/services/objectstore.py,sha256=JgQrL9z_6aG5micVd7I2N6l3RA4EUJh4T2BCuC_ATwQ,20161
|
|
103
103
|
application_sdk/services/secretstore.py,sha256=Jd2gYyBcF31x8Hs8d5J93SWBXBdt6ULGvSk-Gfxb8Dw,19072
|
|
104
104
|
application_sdk/services/statestore.py,sha256=3-afiM3Vsoe1XDYRokdGTB5I5CwOKyieuX5RwIZf77o,9413
|
|
105
105
|
application_sdk/test_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -159,8 +159,8 @@ application_sdk/workflows/metadata_extraction/__init__.py,sha256=jHUe_ZBQ66jx8bg
|
|
|
159
159
|
application_sdk/workflows/metadata_extraction/sql.py,sha256=6ZaVt84n-8U2ZvR9GR7uIJKv5v8CuyQjhlnoRJvDszc,12435
|
|
160
160
|
application_sdk/workflows/query_extraction/__init__.py,sha256=n066_CX5RpJz6DIxGMkKS3eGSRg03ilaCtsqfJWQb7Q,117
|
|
161
161
|
application_sdk/workflows/query_extraction/sql.py,sha256=kT_JQkLCRZ44ZpaC4QvPL6DxnRIIVh8gYHLqRbMI-hA,4826
|
|
162
|
-
atlan_application_sdk-1.1.
|
|
163
|
-
atlan_application_sdk-1.1.
|
|
164
|
-
atlan_application_sdk-1.1.
|
|
165
|
-
atlan_application_sdk-1.1.
|
|
166
|
-
atlan_application_sdk-1.1.
|
|
162
|
+
atlan_application_sdk-1.1.1.dist-info/METADATA,sha256=Jl7-2G4uwpDurHjW0_t8PAs29-SAtxD7VN9Mrrpth5Q,5890
|
|
163
|
+
atlan_application_sdk-1.1.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
164
|
+
atlan_application_sdk-1.1.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
165
|
+
atlan_application_sdk-1.1.1.dist-info/licenses/NOTICE,sha256=A-XVVGt3KOYuuMmvSMIFkg534F1vHiCggEBp4Ez3wGk,1041
|
|
166
|
+
atlan_application_sdk-1.1.1.dist-info/RECORD,,
|
|
File without changes
|
{atlan_application_sdk-1.1.0.dist-info → atlan_application_sdk-1.1.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{atlan_application_sdk-1.1.0.dist-info → atlan_application_sdk-1.1.1.dist-info}/licenses/NOTICE
RENAMED
|
File without changes
|