atlan-application-sdk 0.1.1rc28__py3-none-any.whl → 0.1.1rc30__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/common/dapr_utils.py +32 -0
- application_sdk/constants.py +2 -2
- application_sdk/handlers/sql.py +1 -1
- application_sdk/inputs/objectstore.py +4 -18
- application_sdk/inputs/statestore.py +3 -1
- application_sdk/outputs/eventstore.py +6 -0
- application_sdk/outputs/statestore.py +2 -2
- application_sdk/server/fastapi/__init__.py +1 -1
- application_sdk/version.py +1 -1
- {atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/METADATA +1 -1
- {atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/RECORD +14 -13
- {atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/WHEEL +0 -0
- {atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/licenses/LICENSE +0 -0
- {atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/licenses/NOTICE +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from dapr import clients
|
|
2
|
+
|
|
3
|
+
from application_sdk.observability.logger_adaptor import get_logger
|
|
4
|
+
|
|
5
|
+
logger = get_logger(__name__)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def is_component_registered(component_name: str) -> bool:
|
|
9
|
+
"""Check if a DAPR component with the given name is registered.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
component_name: Name of the component to check.
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
True if the component is present, False otherwise or on metadata errors.
|
|
16
|
+
"""
|
|
17
|
+
try:
|
|
18
|
+
with clients.DaprClient() as client:
|
|
19
|
+
metadata = client.get_metadata()
|
|
20
|
+
# Each registered component has fields: name, type (e.g., "eventstore")
|
|
21
|
+
for component in getattr(metadata, "registered_components", []):
|
|
22
|
+
if component.name == component_name:
|
|
23
|
+
return True
|
|
24
|
+
return False
|
|
25
|
+
except Exception:
|
|
26
|
+
# If we cannot read metadata, behave conservatively and report unavailable
|
|
27
|
+
logger.warning(
|
|
28
|
+
"Failed to read Dapr metadata for component availability check; treating as unavailable",
|
|
29
|
+
exc_info=True,
|
|
30
|
+
extra={"component_name": component_name},
|
|
31
|
+
)
|
|
32
|
+
return False
|
application_sdk/constants.py
CHANGED
|
@@ -131,9 +131,9 @@ EVENT_STORE_NAME = os.getenv("EVENT_STORE_NAME", "eventstore")
|
|
|
131
131
|
#: Whether to enable Atlan storage upload
|
|
132
132
|
ENABLE_ATLAN_UPLOAD = os.getenv("ENABLE_ATLAN_UPLOAD", "false").lower() == "true"
|
|
133
133
|
# Dapr Client Configuration
|
|
134
|
-
#: Maximum gRPC message length in bytes for Dapr client (default:
|
|
134
|
+
#: Maximum gRPC message length in bytes for Dapr client (default: 100MB)
|
|
135
135
|
DAPR_MAX_GRPC_MESSAGE_LENGTH = int(
|
|
136
|
-
os.getenv("DAPR_MAX_GRPC_MESSAGE_LENGTH", "
|
|
136
|
+
os.getenv("DAPR_MAX_GRPC_MESSAGE_LENGTH", "104857600")
|
|
137
137
|
)
|
|
138
138
|
#: Name of the deployment secret store component in DAPR
|
|
139
139
|
DEPLOYMENT_SECRET_STORE_NAME = os.getenv(
|
application_sdk/handlers/sql.py
CHANGED
|
@@ -116,7 +116,7 @@ class BaseSQLHandler(HandlerInterface):
|
|
|
116
116
|
async def fetch_metadata(
|
|
117
117
|
self,
|
|
118
118
|
metadata_type: Optional[str] = None,
|
|
119
|
-
database:
|
|
119
|
+
database: str = "",
|
|
120
120
|
) -> List[Dict[str, str]]:
|
|
121
121
|
"""
|
|
122
122
|
Fetch metadata based on the requested type.
|
|
@@ -79,25 +79,11 @@ class ObjectStoreInput:
|
|
|
79
79
|
try:
|
|
80
80
|
# List all files in the object store path
|
|
81
81
|
relative_path = os.path.relpath(file_path, download_file_prefix)
|
|
82
|
-
|
|
82
|
+
file_list = cls.list_all_files(relative_path, object_store_name)
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
operation=cls.OBJECT_LIST_OPERATION, metadata=metadata
|
|
88
|
-
)
|
|
89
|
-
file_list = orjson.loads(response_data.decode("utf-8"))
|
|
90
|
-
except Exception as e:
|
|
91
|
-
logger.error(
|
|
92
|
-
f"Error listing files in object store path {download_file_prefix}: {str(e)}"
|
|
93
|
-
)
|
|
94
|
-
raise e
|
|
95
|
-
|
|
96
|
-
if not file_list:
|
|
97
|
-
logger.info(
|
|
98
|
-
f"No files found in object store path: {download_file_prefix}"
|
|
99
|
-
)
|
|
100
|
-
return
|
|
84
|
+
logger.info(
|
|
85
|
+
f"Found list of files: {file_list} from: {download_file_prefix}"
|
|
86
|
+
)
|
|
101
87
|
|
|
102
88
|
# Download each file
|
|
103
89
|
for relative_path in file_list:
|
|
@@ -76,6 +76,7 @@ class StateStoreInput:
|
|
|
76
76
|
state = {}
|
|
77
77
|
|
|
78
78
|
try:
|
|
79
|
+
logger.info(f"Trying to download state object for {id} with type {type}")
|
|
79
80
|
local_state_file_path = os.path.join(TEMPORARY_PATH, state_file_path)
|
|
80
81
|
ObjectStoreInput.download_file_from_object_store(
|
|
81
82
|
download_file_prefix=TEMPORARY_PATH,
|
|
@@ -86,10 +87,11 @@ class StateStoreInput:
|
|
|
86
87
|
with open(local_state_file_path, "r") as file:
|
|
87
88
|
state = json.load(file)
|
|
88
89
|
|
|
90
|
+
logger.info(f"State object downloaded for {id} with type {type}")
|
|
89
91
|
except Exception as e:
|
|
90
92
|
# local error message is "file not found", while in object store it is "object not found"
|
|
91
93
|
if "not found" in str(e).lower():
|
|
92
|
-
logger.
|
|
94
|
+
logger.info(
|
|
93
95
|
f"No state found for {type.value} with id '{id}', returning empty dict"
|
|
94
96
|
)
|
|
95
97
|
else:
|
|
@@ -14,6 +14,7 @@ from dapr import clients
|
|
|
14
14
|
from pydantic import BaseModel, Field
|
|
15
15
|
from temporalio import activity, workflow
|
|
16
16
|
|
|
17
|
+
from application_sdk.common.dapr_utils import is_component_registered
|
|
17
18
|
from application_sdk.constants import APPLICATION_NAME, EVENT_STORE_NAME
|
|
18
19
|
from application_sdk.observability.logger_adaptor import get_logger
|
|
19
20
|
|
|
@@ -155,6 +156,11 @@ class EventStore:
|
|
|
155
156
|
Example:
|
|
156
157
|
>>> EventStore.create_generic_event(Event(event_type="test", data={"test": "test"}))
|
|
157
158
|
"""
|
|
159
|
+
if not is_component_registered(EVENT_STORE_NAME):
|
|
160
|
+
logger.warning(
|
|
161
|
+
"Skipping event publish because event store component is not registered",
|
|
162
|
+
)
|
|
163
|
+
return
|
|
158
164
|
try:
|
|
159
165
|
if enrich_metadata:
|
|
160
166
|
event = cls.enrich_event_metadata(event)
|
|
@@ -84,8 +84,8 @@ class StateStoreOutput:
|
|
|
84
84
|
>>> from application_sdk.outputs.statestore import StateStoreOutput
|
|
85
85
|
>>> await StateStoreOutput.save_state_object("wf-123", {"test": "test"}, "workflow")
|
|
86
86
|
"""
|
|
87
|
-
|
|
88
87
|
try:
|
|
88
|
+
logger.info(f"Saving state object for {id} with type {type}")
|
|
89
89
|
# get the current state from object store
|
|
90
90
|
current_state = StateStoreInput.get_state(id, type)
|
|
91
91
|
state_file_path = build_state_store_path(id, type)
|
|
@@ -106,7 +106,7 @@ class StateStoreOutput:
|
|
|
106
106
|
file_path=local_state_file_path,
|
|
107
107
|
object_store_name=UPSTREAM_OBJECT_STORE_NAME,
|
|
108
108
|
)
|
|
109
|
-
|
|
109
|
+
logger.info(f"State object saved for {id} with type {type}")
|
|
110
110
|
return current_state
|
|
111
111
|
except Exception as e:
|
|
112
112
|
logger.error(f"Failed to store state: {str(e)}")
|
application_sdk/version.py
CHANGED
{atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atlan-application-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1rc30
|
|
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
|
{atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
application_sdk/__init__.py,sha256=2e2mvmLJ5dxmJGPELtb33xwP-j6JMdoIuqKycEn7hjg,151
|
|
2
|
-
application_sdk/constants.py,sha256=
|
|
3
|
-
application_sdk/version.py,sha256=
|
|
2
|
+
application_sdk/constants.py,sha256=JMJdTVjIJZX1XrvxISAcPh3YQ3aYKBTSQ2thqiF8BR4,9304
|
|
3
|
+
application_sdk/version.py,sha256=JWzagPnLJJesFA2rkpWvghXzlW-fdaQlCWDoL0vAsJ4,88
|
|
4
4
|
application_sdk/worker.py,sha256=2fLjuKNJafhaQXrHzmxXYO22F4ZSc0igMjoxXVNBFfk,6167
|
|
5
5
|
application_sdk/activities/__init__.py,sha256=EH5VTHcfGykIX7V1HsG0J1Z-1FbJEXTQOET0HdzFDjU,9519
|
|
6
6
|
application_sdk/activities/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -23,6 +23,7 @@ application_sdk/clients/workflow.py,sha256=6bSqmA3sNCk9oY68dOjBUDZ9DhNKQxPD75qqE
|
|
|
23
23
|
application_sdk/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
application_sdk/common/aws_utils.py,sha256=aeL3BTMzv1UWJ4KxfwY5EsfYnxtS1FKNJ4xKdHeoTjc,3438
|
|
25
25
|
application_sdk/common/credential_utils.py,sha256=M9oraG2uPeOSbxUAOJlP2IeClsDD79EhNkdow42dFsI,3025
|
|
26
|
+
application_sdk/common/dapr_utils.py,sha256=0yHqDP6qNb1OT-bX2XRYQPZ5xkGkV13nyRw6GkPlHs8,1136
|
|
26
27
|
application_sdk/common/dataframe_utils.py,sha256=PId9vT6AUoq3tesiTd4sSUvW7RUhPWdAAEBLuOprks4,1262
|
|
27
28
|
application_sdk/common/error_codes.py,sha256=uROVfOOMrGPO8JroWB3vs5rIEhr0GfcPqXAK9wdhcVQ,13742
|
|
28
29
|
application_sdk/common/utils.py,sha256=ktCZLp-AEiyd-IPOgbD83Dg9qa8Z0Sj_mJmmdSzpOak,14759
|
|
@@ -42,15 +43,15 @@ application_sdk/docgen/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
|
42
43
|
application_sdk/docgen/parsers/directory.py,sha256=8Kk2sjb-0l2wLO_njdlcuHjv5akoNgmf-FmaDSaE4WM,7751
|
|
43
44
|
application_sdk/docgen/parsers/manifest.py,sha256=3NP-dBTpHAUQa477usMIDaKSb_9xfLE8G3RX0T1Bq2s,3318
|
|
44
45
|
application_sdk/handlers/__init__.py,sha256=U7kKwVWK0FZz1uIJ2ANN0C5tD83k_9Nyz0ns6ttr92g,1152
|
|
45
|
-
application_sdk/handlers/sql.py,sha256=
|
|
46
|
+
application_sdk/handlers/sql.py,sha256=oeB-sgWwPYo31xaD87TyMc0h51Sary1F-CmhExt9_Pk,16100
|
|
46
47
|
application_sdk/inputs/__init__.py,sha256=_d-cUhcDyoJTJR3PdQkC831go6VDw9AM6Bg7-qm3NHI,1900
|
|
47
48
|
application_sdk/inputs/iceberg.py,sha256=xiv1kNtVx1k0h3ZJbJeXjZwdfBGSy9j9orYP_AyCYlI,2756
|
|
48
49
|
application_sdk/inputs/json.py,sha256=J1CVz0YGQHDyq840TyoBHE7Baua2yIFHzsrybiZbeWk,6079
|
|
49
|
-
application_sdk/inputs/objectstore.py,sha256=
|
|
50
|
+
application_sdk/inputs/objectstore.py,sha256=uOJW0uB3FrDmnyHFhAd23QOq3MKrAzhYdKCszdpMeF8,8219
|
|
50
51
|
application_sdk/inputs/parquet.py,sha256=Hsi6Nz_KwxFMB6DcHSQov5y_hRkoeN7e4xfpYwogveo,6346
|
|
51
52
|
application_sdk/inputs/secretstore.py,sha256=WPGvsPMLUaARvXA6JSa4uHp7tQcCW4NMIIUDQyM3F-I,3946
|
|
52
53
|
application_sdk/inputs/sql_query.py,sha256=1EREgea6kKNaMIyX2HLJgbJ07rtAgLasd9NyvDcdZok,10636
|
|
53
|
-
application_sdk/inputs/statestore.py,sha256=
|
|
54
|
+
application_sdk/inputs/statestore.py,sha256=ORWnv8ZCqC1wT4vlW4v5EemJT4oQ3t_DlpjKDAgTRTs,3117
|
|
54
55
|
application_sdk/observability/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
56
|
application_sdk/observability/logger_adaptor.py,sha256=WTqnNg78W2SRGOQVhELVLn6KMRsurkG1kc7essL08Lk,29529
|
|
56
57
|
application_sdk/observability/metrics_adaptor.py,sha256=4TYPNn38zLeqxwf7cUbe8wh_zwQlr-nyiXjJsiEhTEM,16445
|
|
@@ -60,15 +61,15 @@ application_sdk/observability/utils.py,sha256=MKEpT0WYtpATUgLgJDkGQaAP_t-jpDYMUK
|
|
|
60
61
|
application_sdk/observability/decorators/observability_decorator.py,sha256=JNrWNXT5W4klmlAc5b8C3_VBjDu0PI64W2ptr7LMzk4,8110
|
|
61
62
|
application_sdk/outputs/__init__.py,sha256=HX8VcN22xyrkoRWdjQj8TrC5dEUG7cPzOcvJhlprqAs,8415
|
|
62
63
|
application_sdk/outputs/atlan_storage.py,sha256=HQLbuyOZQC-GxYAiCVJakIJizTWy926tdMGOHvaBlD8,6029
|
|
63
|
-
application_sdk/outputs/eventstore.py,sha256=
|
|
64
|
+
application_sdk/outputs/eventstore.py,sha256=MY9x_2A8Gempa1B3GQJ-C-B4dVrqO5u4Sfpla-2u91Q,5827
|
|
64
65
|
application_sdk/outputs/iceberg.py,sha256=IGtj5WDgqLu6vzDEvw5DLsKsjm29Krto3AHvWpemr0A,5311
|
|
65
66
|
application_sdk/outputs/json.py,sha256=xF-8mY3BZRRejip4s9npIUuFaAxgFmBQVaLMkrI_iCI,14117
|
|
66
67
|
application_sdk/outputs/objectstore.py,sha256=TJvgfkJpGRK129ttxY7qRYJ7ASKZA4R6-0BUA3Lk7mc,4450
|
|
67
68
|
application_sdk/outputs/parquet.py,sha256=A2EnEx1zWjaXk10u3eJusmWxGxt8WR7CHXDaJgsKpq0,11040
|
|
68
69
|
application_sdk/outputs/secretstore.py,sha256=JS9vUzb11leDpcMQSCnLJuE9Ww-9G3wMvCdUKBPaw9I,1342
|
|
69
|
-
application_sdk/outputs/statestore.py,sha256=
|
|
70
|
+
application_sdk/outputs/statestore.py,sha256=XiEag2e9WW3_D3xbWQGoNrHiFJz9916qcIvhrROX8_8,3999
|
|
70
71
|
application_sdk/server/__init__.py,sha256=KTqE1YPw_3WDVMWatJUuf9OOiobLM2K5SMaBrI62sCo,1568
|
|
71
|
-
application_sdk/server/fastapi/__init__.py,sha256=
|
|
72
|
+
application_sdk/server/fastapi/__init__.py,sha256=MnyLA75XP0_k3_yGp9nw9CTxw4Qa1DIZIs__BgzqJWI,27781
|
|
72
73
|
application_sdk/server/fastapi/models.py,sha256=mFFxteDS3ZYXaq7Apor_Meo5WNxTCxqdrMkmTKQjvP0,6687
|
|
73
74
|
application_sdk/server/fastapi/utils.py,sha256=2XI4DylhRQsukhX67lpAzRNCHeFCSpbuNd7TlE2IBJA,1164
|
|
74
75
|
application_sdk/server/fastapi/middleware/logmiddleware.py,sha256=CxcPtDmCbSfSZ8RyI09nIshVIbCokyyA9bByQJ2G_ns,2545
|
|
@@ -130,8 +131,8 @@ application_sdk/workflows/metadata_extraction/__init__.py,sha256=jHUe_ZBQ66jx8bg
|
|
|
130
131
|
application_sdk/workflows/metadata_extraction/sql.py,sha256=_NhszxIgmcQI6lVpjJoyJRFLwPYvJw1Dyqox_m9K2RA,11947
|
|
131
132
|
application_sdk/workflows/query_extraction/__init__.py,sha256=n066_CX5RpJz6DIxGMkKS3eGSRg03ilaCtsqfJWQb7Q,117
|
|
132
133
|
application_sdk/workflows/query_extraction/sql.py,sha256=kT_JQkLCRZ44ZpaC4QvPL6DxnRIIVh8gYHLqRbMI-hA,4826
|
|
133
|
-
atlan_application_sdk-0.1.
|
|
134
|
-
atlan_application_sdk-0.1.
|
|
135
|
-
atlan_application_sdk-0.1.
|
|
136
|
-
atlan_application_sdk-0.1.
|
|
137
|
-
atlan_application_sdk-0.1.
|
|
134
|
+
atlan_application_sdk-0.1.1rc30.dist-info/METADATA,sha256=iT4sH5JQ7eYpgokSzDzPqZIuMVJwMZxmUPxNK7iSGWo,5473
|
|
135
|
+
atlan_application_sdk-0.1.1rc30.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
136
|
+
atlan_application_sdk-0.1.1rc30.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
137
|
+
atlan_application_sdk-0.1.1rc30.dist-info/licenses/NOTICE,sha256=A-XVVGt3KOYuuMmvSMIFkg534F1vHiCggEBp4Ez3wGk,1041
|
|
138
|
+
atlan_application_sdk-0.1.1rc30.dist-info/RECORD,,
|
{atlan_application_sdk-0.1.1rc28.dist-info → atlan_application_sdk-0.1.1rc30.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|