atlan-application-sdk 0.1.1rc54__py3-none-any.whl → 0.1.1rc56__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/clients/models.py +5 -1
- application_sdk/clients/sql.py +8 -9
- application_sdk/observability/logger_adaptor.py +29 -14
- application_sdk/observability/metrics_adaptor.py +1 -0
- application_sdk/version.py +1 -1
- {atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.dist-info}/METADATA +2 -1
- {atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.dist-info}/RECORD +10 -10
- {atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.dist-info}/WHEEL +0 -0
- {atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.dist-info}/licenses/LICENSE +0 -0
- {atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.dist-info}/licenses/NOTICE +0 -0
|
@@ -31,7 +31,11 @@ class DatabaseConfig(BaseModel):
|
|
|
31
31
|
)
|
|
32
32
|
parameters: Optional[List[str]] = Field(
|
|
33
33
|
default=None,
|
|
34
|
-
description="List of additional connection parameter names that can be dynamically added from credentials",
|
|
34
|
+
description="List of additional connection parameter names that can be dynamically added from credentials to the connection string. ex: ['ssl_mode'] will be added to the connection string as ?ssl_mode=require",
|
|
35
|
+
)
|
|
36
|
+
connect_args: Dict[str, Any] = Field(
|
|
37
|
+
default_factory=dict,
|
|
38
|
+
description="Additional connection arguments to be passed to SQLAlchemy. ex: {'sslmode': 'require'}",
|
|
35
39
|
)
|
|
36
40
|
|
|
37
41
|
class Config:
|
application_sdk/clients/sql.py
CHANGED
|
@@ -37,7 +37,6 @@ class BaseSQLClient(ClientInterface):
|
|
|
37
37
|
Attributes:
|
|
38
38
|
connection: Database connection instance.
|
|
39
39
|
engine: SQLAlchemy engine instance.
|
|
40
|
-
sql_alchemy_connect_args (Dict[str, Any]): Additional connection arguments.
|
|
41
40
|
credentials (Dict[str, Any]): Database credentials.
|
|
42
41
|
resolved_credentials (Dict[str, Any]): Resolved credentials after reading from secret manager.
|
|
43
42
|
use_server_side_cursor (bool): Whether to use server-side cursors.
|
|
@@ -45,7 +44,6 @@ class BaseSQLClient(ClientInterface):
|
|
|
45
44
|
|
|
46
45
|
connection = None
|
|
47
46
|
engine = None
|
|
48
|
-
sql_alchemy_connect_args: Dict[str, Any] = {}
|
|
49
47
|
credentials: Dict[str, Any] = {}
|
|
50
48
|
resolved_credentials: Dict[str, Any] = {}
|
|
51
49
|
use_server_side_cursor: bool = USE_SERVER_SIDE_CURSOR
|
|
@@ -55,7 +53,6 @@ class BaseSQLClient(ClientInterface):
|
|
|
55
53
|
self,
|
|
56
54
|
use_server_side_cursor: bool = USE_SERVER_SIDE_CURSOR,
|
|
57
55
|
credentials: Dict[str, Any] = {},
|
|
58
|
-
sql_alchemy_connect_args: Dict[str, Any] = {},
|
|
59
56
|
):
|
|
60
57
|
"""
|
|
61
58
|
Initialize the SQL client.
|
|
@@ -64,12 +61,9 @@ class BaseSQLClient(ClientInterface):
|
|
|
64
61
|
use_server_side_cursor (bool, optional): Whether to use server-side cursors.
|
|
65
62
|
Defaults to USE_SERVER_SIDE_CURSOR.
|
|
66
63
|
credentials (Dict[str, Any], optional): Database credentials. Defaults to {}.
|
|
67
|
-
sql_alchemy_connect_args (Dict[str, Any], optional): Additional SQLAlchemy
|
|
68
|
-
connection arguments. Defaults to {}.
|
|
69
64
|
"""
|
|
70
65
|
self.use_server_side_cursor = use_server_side_cursor
|
|
71
66
|
self.credentials = credentials
|
|
72
|
-
self.sql_alchemy_connect_args = sql_alchemy_connect_args
|
|
73
67
|
|
|
74
68
|
async def load(self, credentials: Dict[str, Any]) -> None:
|
|
75
69
|
"""Load credentials and prepare engine for lazy connections.
|
|
@@ -83,6 +77,9 @@ class BaseSQLClient(ClientInterface):
|
|
|
83
77
|
Raises:
|
|
84
78
|
ClientError: If credentials are invalid or engine creation fails
|
|
85
79
|
"""
|
|
80
|
+
if not self.DB_CONFIG:
|
|
81
|
+
raise ValueError("DB_CONFIG is not configured for this SQL client.")
|
|
82
|
+
|
|
86
83
|
self.credentials = credentials # Update the instance credentials
|
|
87
84
|
try:
|
|
88
85
|
from sqlalchemy import create_engine
|
|
@@ -90,7 +87,7 @@ class BaseSQLClient(ClientInterface):
|
|
|
90
87
|
# Create engine but no persistent connection
|
|
91
88
|
self.engine = create_engine(
|
|
92
89
|
self.get_sqlalchemy_connection_string(),
|
|
93
|
-
connect_args=self.
|
|
90
|
+
connect_args=self.DB_CONFIG.connect_args,
|
|
94
91
|
pool_pre_ping=True,
|
|
95
92
|
)
|
|
96
93
|
|
|
@@ -397,7 +394,6 @@ class AsyncBaseSQLClient(BaseSQLClient):
|
|
|
397
394
|
Attributes:
|
|
398
395
|
connection (AsyncConnection): Async database connection instance.
|
|
399
396
|
engine (AsyncEngine): Async SQLAlchemy engine instance.
|
|
400
|
-
sql_alchemy_connect_args (Dict[str, Any]): Additional connection arguments.
|
|
401
397
|
credentials (Dict[str, Any]): Database credentials.
|
|
402
398
|
use_server_side_cursor (bool): Whether to use server-side cursors.
|
|
403
399
|
"""
|
|
@@ -419,13 +415,16 @@ class AsyncBaseSQLClient(BaseSQLClient):
|
|
|
419
415
|
ValueError: If credentials are invalid or engine creation fails.
|
|
420
416
|
"""
|
|
421
417
|
self.credentials = credentials
|
|
418
|
+
if not self.DB_CONFIG:
|
|
419
|
+
raise ValueError("DB_CONFIG is not configured for this SQL client.")
|
|
420
|
+
|
|
422
421
|
try:
|
|
423
422
|
from sqlalchemy.ext.asyncio import create_async_engine
|
|
424
423
|
|
|
425
424
|
# Create async engine but no persistent connection
|
|
426
425
|
self.engine = create_async_engine(
|
|
427
426
|
self.get_sqlalchemy_connection_string(),
|
|
428
|
-
connect_args=self.
|
|
427
|
+
connect_args=self.DB_CONFIG.connect_args,
|
|
429
428
|
pool_pre_ping=True,
|
|
430
429
|
)
|
|
431
430
|
if not self.engine:
|
|
@@ -211,14 +211,20 @@ for logger_name in DEPENDENCY_LOGGERS:
|
|
|
211
211
|
|
|
212
212
|
# Add these constants
|
|
213
213
|
SEVERITY_MAPPING = {
|
|
214
|
-
"DEBUG":
|
|
215
|
-
"INFO":
|
|
216
|
-
"WARNING":
|
|
217
|
-
"ERROR":
|
|
218
|
-
"CRITICAL":
|
|
219
|
-
"ACTIVITY":
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
"DEBUG": logging.getLevelNamesMapping()["DEBUG"],
|
|
215
|
+
"INFO": logging.getLevelNamesMapping()["INFO"],
|
|
216
|
+
"WARNING": logging.getLevelNamesMapping()["WARNING"],
|
|
217
|
+
"ERROR": logging.getLevelNamesMapping()["ERROR"],
|
|
218
|
+
"CRITICAL": logging.getLevelNamesMapping()["CRITICAL"],
|
|
219
|
+
"ACTIVITY": logging.getLevelNamesMapping()[
|
|
220
|
+
"INFO"
|
|
221
|
+
], # Using INFO severity for activity level
|
|
222
|
+
"METRIC": logging.getLevelNamesMapping()[
|
|
223
|
+
"DEBUG"
|
|
224
|
+
], # Using DEBUG severity for metric level
|
|
225
|
+
"TRACING": logging.getLevelNamesMapping()[
|
|
226
|
+
"DEBUG"
|
|
227
|
+
], # Using DEBUG severity for tracing level
|
|
222
228
|
}
|
|
223
229
|
|
|
224
230
|
|
|
@@ -264,25 +270,34 @@ class AtlanLoggerAdapter(AtlanObservability[LogRecordModel]):
|
|
|
264
270
|
|
|
265
271
|
# Register custom log level for activity
|
|
266
272
|
if "ACTIVITY" not in logger._core.levels:
|
|
267
|
-
logger.level(
|
|
273
|
+
logger.level(
|
|
274
|
+
"ACTIVITY", no=SEVERITY_MAPPING["ACTIVITY"], color="<cyan>", icon="🔵"
|
|
275
|
+
)
|
|
268
276
|
|
|
269
277
|
# Register custom log level for metrics
|
|
270
278
|
if "METRIC" not in logger._core.levels:
|
|
271
|
-
logger.level(
|
|
279
|
+
logger.level(
|
|
280
|
+
"METRIC", no=SEVERITY_MAPPING["METRIC"], color="<yellow>", icon="📊"
|
|
281
|
+
)
|
|
272
282
|
|
|
273
283
|
# Register custom log level for tracing
|
|
274
284
|
if "TRACING" not in logger._core.levels:
|
|
275
|
-
logger.level(
|
|
285
|
+
logger.level(
|
|
286
|
+
"TRACING", no=SEVERITY_MAPPING["TRACING"], color="<magenta>", icon="🔍"
|
|
287
|
+
)
|
|
276
288
|
|
|
277
289
|
# Update format string to use the bound logger_name
|
|
278
290
|
atlan_format_str = "<green>{time:YYYY-MM-DD HH:mm:ss}</green> <blue>[{level}]</blue> <cyan>{extra[logger_name]}</cyan> - <level>{message}</level>"
|
|
279
291
|
self.logger.add(
|
|
280
|
-
sys.stderr,
|
|
292
|
+
sys.stderr,
|
|
293
|
+
format=atlan_format_str,
|
|
294
|
+
level=SEVERITY_MAPPING[LOG_LEVEL],
|
|
295
|
+
colorize=True,
|
|
281
296
|
)
|
|
282
297
|
|
|
283
298
|
# Add sink for parquet logging only if Dapr sink is enabled
|
|
284
299
|
if ENABLE_OBSERVABILITY_DAPR_SINK:
|
|
285
|
-
self.logger.add(self.parquet_sink, level=LOG_LEVEL)
|
|
300
|
+
self.logger.add(self.parquet_sink, level=SEVERITY_MAPPING[LOG_LEVEL])
|
|
286
301
|
# Start flush task only if Dapr sink is enabled
|
|
287
302
|
if not AtlanLoggerAdapter._flush_task_started:
|
|
288
303
|
try:
|
|
@@ -341,7 +356,7 @@ class AtlanLoggerAdapter(AtlanObservability[LogRecordModel]):
|
|
|
341
356
|
self.logger_provider.add_log_record_processor(batch_processor)
|
|
342
357
|
|
|
343
358
|
# Add OTLP sink
|
|
344
|
-
self.logger.add(self.otlp_sink, level=LOG_LEVEL)
|
|
359
|
+
self.logger.add(self.otlp_sink, level=SEVERITY_MAPPING[LOG_LEVEL])
|
|
345
360
|
|
|
346
361
|
except Exception as e:
|
|
347
362
|
logging.error(f"Failed to setup OTLP logging: {str(e)}")
|
application_sdk/version.py
CHANGED
{atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.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.1rc56
|
|
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
|
|
@@ -62,6 +62,7 @@ Description-Content-Type: text/markdown
|
|
|
62
62
|
|
|
63
63
|
# Atlan Application SDK
|
|
64
64
|
[](https://github.com/atlanhq/application-sdk/actions/workflows/push.yaml) [](https://github.com/atlanhq/application-sdk/actions/workflows/codeql.yaml) [](https://pypi.org/project/atlan-application-sdk/)
|
|
65
|
+
[](https://deepwiki.com/atlanhq/application-sdk)
|
|
65
66
|
|
|
66
67
|
The Atlan Application SDK is a Python library designed for building applications on the Atlan platform. It offers a full PaaS (Platform-as-a-Service) toolkit — from local development to deployment and partner collaboration — so you can create integrations and tools that seamlessly extend the Atlan experience for our mutual customers.
|
|
67
68
|
|
{atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
application_sdk/__init__.py,sha256=2e2mvmLJ5dxmJGPELtb33xwP-j6JMdoIuqKycEn7hjg,151
|
|
2
2
|
application_sdk/constants.py,sha256=EDGR-3SuCxNV-3x0D4wA9is9vBbVWa3nHvJ8r2w4lYY,10977
|
|
3
|
-
application_sdk/version.py,sha256=
|
|
3
|
+
application_sdk/version.py,sha256=CCMicPBa6AW-ZhzHhVwaijqXeu7blFhs7s9tQzWI3V8,88
|
|
4
4
|
application_sdk/worker.py,sha256=i5f0AeKI39IfsLO05QkwC6uMz0zDPSJqP7B2byri1VI,7489
|
|
5
5
|
application_sdk/activities/__init__.py,sha256=L5WXkTwOwGtjWAlXrUJRCKGwyIyp3z8fBv8BZVCRFQI,11175
|
|
6
6
|
application_sdk/activities/lock_management.py,sha256=oX2qPpfEu_xP0MiaCakVGk9ivZDvG4EddVZag1DuHSE,3976
|
|
@@ -20,9 +20,9 @@ application_sdk/clients/__init__.py,sha256=C9T84J7V6ZumcoWJPAxdd3tqSmbyciaGBJn-C
|
|
|
20
20
|
application_sdk/clients/atlan.py,sha256=l6yV39fr1006SJFwkOTNDQlbSFlHCZQaUPfdUlzdVEg,5053
|
|
21
21
|
application_sdk/clients/atlan_auth.py,sha256=D7FuNqv81ohNXLJtdx1AFw_jU6a3g0Pw6149ia4ucFY,8930
|
|
22
22
|
application_sdk/clients/base.py,sha256=TIn3pG89eXUc1XSYf4jk66m1vajWp0WxcCQOOltdazA,14021
|
|
23
|
-
application_sdk/clients/models.py,sha256=
|
|
23
|
+
application_sdk/clients/models.py,sha256=iZOTyH6LO64kozdiUPCFCN0NgLhd_Gtv0lH7ZIPdo8w,1800
|
|
24
24
|
application_sdk/clients/redis.py,sha256=IfAD32vLp88BCvsDTaQtxFHxzHlEx4V7TK7h1HwDDBg,15917
|
|
25
|
-
application_sdk/clients/sql.py,sha256=
|
|
25
|
+
application_sdk/clients/sql.py,sha256=lXeVu_dute30IaWWK5gHBhjEs2dXp_e0XkOMsbOsq64,19589
|
|
26
26
|
application_sdk/clients/temporal.py,sha256=jC3U8LmW8G6gg-Qmxk0rcAifIGF0KekwP1UkMGXN7RA,18314
|
|
27
27
|
application_sdk/clients/utils.py,sha256=zLFOJbTr_6TOqnjfVFGY85OtIXZ4FQy_rquzjaydkbY,779
|
|
28
28
|
application_sdk/clients/workflow.py,sha256=6bSqmA3sNCk9oY68dOjBUDZ9DhNKQxPD75qqE0cfldc,6104
|
|
@@ -71,8 +71,8 @@ application_sdk/interceptors/events.py,sha256=TeStWmBbc4v1-dm2DWeKYsUfUhJLR8CtTQ
|
|
|
71
71
|
application_sdk/interceptors/lock.py,sha256=K1e1p11OYDDTy5TFMHcKXAvY4H86yXgpAZiuncEyH2M,5810
|
|
72
72
|
application_sdk/interceptors/.cursor/BUGBOT.md,sha256=pxmUF2c7dtaXAX8yAa1-LBa6FCrj_uw7aQcHrppjf1A,14570
|
|
73
73
|
application_sdk/observability/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
-
application_sdk/observability/logger_adaptor.py,sha256=
|
|
75
|
-
application_sdk/observability/metrics_adaptor.py,sha256=
|
|
74
|
+
application_sdk/observability/logger_adaptor.py,sha256=00c0F7maDkp1xrHttW6VQbWFDGr6NkXeDPjmf97ojlY,29989
|
|
75
|
+
application_sdk/observability/metrics_adaptor.py,sha256=5Oz02lUED60duryoVDF9mbD11fpxhbXi7P1609n_15Y,16446
|
|
76
76
|
application_sdk/observability/observability.py,sha256=DP0I4bHyg3TA4hxCqDFy2IiRmBGOpZ7449m7BUoc_RA,24530
|
|
77
77
|
application_sdk/observability/traces_adaptor.py,sha256=0eQJPN-tYA_dV8D3uEa5ZiX9g12NDuLnPaFuQMVDdL0,18242
|
|
78
78
|
application_sdk/observability/utils.py,sha256=MKEpT0WYtpATUgLgJDkGQaAP_t-jpDYMUKDfEvr8Phg,2448
|
|
@@ -157,8 +157,8 @@ application_sdk/workflows/metadata_extraction/__init__.py,sha256=jHUe_ZBQ66jx8bg
|
|
|
157
157
|
application_sdk/workflows/metadata_extraction/sql.py,sha256=6ZaVt84n-8U2ZvR9GR7uIJKv5v8CuyQjhlnoRJvDszc,12435
|
|
158
158
|
application_sdk/workflows/query_extraction/__init__.py,sha256=n066_CX5RpJz6DIxGMkKS3eGSRg03ilaCtsqfJWQb7Q,117
|
|
159
159
|
application_sdk/workflows/query_extraction/sql.py,sha256=kT_JQkLCRZ44ZpaC4QvPL6DxnRIIVh8gYHLqRbMI-hA,4826
|
|
160
|
-
atlan_application_sdk-0.1.
|
|
161
|
-
atlan_application_sdk-0.1.
|
|
162
|
-
atlan_application_sdk-0.1.
|
|
163
|
-
atlan_application_sdk-0.1.
|
|
164
|
-
atlan_application_sdk-0.1.
|
|
160
|
+
atlan_application_sdk-0.1.1rc56.dist-info/METADATA,sha256=IYJMZEWVkGa4E4e5xGGho-QuvP4NzHOIRY5Jnzi2wU8,5730
|
|
161
|
+
atlan_application_sdk-0.1.1rc56.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
162
|
+
atlan_application_sdk-0.1.1rc56.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
163
|
+
atlan_application_sdk-0.1.1rc56.dist-info/licenses/NOTICE,sha256=A-XVVGt3KOYuuMmvSMIFkg534F1vHiCggEBp4Ez3wGk,1041
|
|
164
|
+
atlan_application_sdk-0.1.1rc56.dist-info/RECORD,,
|
{atlan_application_sdk-0.1.1rc54.dist-info → atlan_application_sdk-0.1.1rc56.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|