adapta 2.11.9__py3-none-any.whl → 3.5.13__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.
- adapta/__init__.py +1 -1
- adapta/_version.py +1 -1
- adapta/connectors/__init__.py +1 -1
- adapta/connectors/service_bus/__init__.py +1 -1
- adapta/connectors/service_bus/_connector.py +2 -3
- adapta/logs/__init__.py +1 -1
- adapta/logs/_async_logger.py +38 -24
- adapta/logs/_base.py +21 -21
- adapta/logs/_internal.py +6 -7
- adapta/logs/_internal_logger.py +113 -41
- adapta/logs/_logger_interface.py +9 -10
- adapta/logs/handlers/__init__.py +1 -1
- adapta/logs/handlers/datadog_api_handler.py +7 -7
- adapta/logs/handlers/safe_stream_handler.py +4 -4
- adapta/logs/models/__init__.py +1 -1
- adapta/logs/models/_log_level.py +1 -1
- adapta/logs/models/_logs_metadata.py +4 -5
- adapta/metrics/__init__.py +1 -1
- adapta/metrics/_base.py +14 -15
- adapta/metrics/providers/__init__.py +1 -1
- adapta/metrics/providers/datadog_provider.py +21 -22
- adapta/metrics/providers/void_provider.py +34 -0
- adapta/ml/__init__.py +1 -1
- adapta/ml/_model.py +1 -1
- adapta/ml/mlflow/__init__.py +1 -1
- adapta/ml/mlflow/_client.py +101 -5
- adapta/ml/mlflow/_functions.py +44 -13
- adapta/process_communication/__init__.py +1 -1
- adapta/process_communication/_models.py +8 -6
- adapta/schema_management/README.md +0 -1
- adapta/schema_management/__init__.py +1 -1
- adapta/schema_management/schema_entity.py +3 -3
- adapta/security/__init__.py +1 -1
- adapta/security/clients/__init__.py +1 -1
- adapta/security/clients/_azure_client.py +14 -12
- adapta/security/clients/_base.py +11 -6
- adapta/security/clients/_local_client.py +6 -6
- adapta/security/clients/aws/__init__.py +1 -1
- adapta/security/clients/aws/_aws_client.py +12 -10
- adapta/security/clients/aws/_aws_credentials.py +7 -8
- adapta/security/clients/hashicorp_vault/__init__.py +1 -1
- adapta/security/clients/hashicorp_vault/hashicorp_vault_client.py +7 -6
- adapta/security/clients/hashicorp_vault/kubernetes_client.py +2 -2
- adapta/security/clients/hashicorp_vault/oidc_client.py +2 -2
- adapta/security/clients/hashicorp_vault/token_client.py +2 -2
- adapta/storage/__init__.py +1 -1
- adapta/storage/blob/README.md +14 -10
- adapta/storage/blob/__init__.py +1 -1
- adapta/storage/blob/azure_storage_client.py +76 -24
- adapta/storage/blob/base.py +15 -13
- adapta/storage/blob/local_storage_client.py +28 -16
- adapta/storage/blob/s3_storage_client.py +19 -24
- adapta/storage/cache/__init__.py +1 -1
- adapta/storage/cache/_base.py +5 -5
- adapta/storage/cache/redis_cache.py +5 -5
- adapta/storage/database/__init__.py +4 -1
- adapta/storage/database/{README.md → v2/README.md} +2 -0
- adapta/storage/database/v2/__init__.py +17 -0
- adapta/storage/database/v2/azure_sql.py +143 -0
- adapta/storage/{distributed_object_store/datastax_astra → database/v2/models}/__init__.py +5 -5
- adapta/storage/database/v2/models/_models.py +53 -0
- adapta/storage/database/{odbc.py → v2/odbc.py} +22 -13
- adapta/storage/database/{snowflake_sql.py → v2/snowflake_sql.py} +20 -12
- adapta/storage/database/{trino_sql.py → v2/trino_sql.py} +15 -6
- adapta/storage/database/v3/README.md +109 -0
- adapta/storage/database/v3/__init__.py +14 -0
- adapta/storage/database/{azure_sql.py → v3/azure_sql.py} +7 -9
- adapta/storage/database/v3/models/__init__.py +19 -0
- adapta/storage/database/{models → v3/models}/_models.py +2 -3
- adapta/storage/database/v3/odbc.py +217 -0
- adapta/storage/database/v3/snowflake_sql.py +241 -0
- adapta/storage/database/v3/trino_sql.py +154 -0
- adapta/storage/delta_lake/__init__.py +2 -3
- adapta/storage/delta_lake/{README.md → v2/README.md} +2 -0
- adapta/storage/delta_lake/v2/__init__.py +19 -0
- adapta/storage/delta_lake/{_functions.py → v2/_functions.py} +43 -27
- adapta/storage/delta_lake/v2/_models.py +72 -0
- adapta/storage/delta_lake/v3/README.md +147 -0
- adapta/storage/delta_lake/v3/__init__.py +20 -0
- adapta/storage/delta_lake/v3/_functions.py +315 -0
- adapta/storage/delta_lake/{_models.py → v3/_models.py} +4 -5
- adapta/storage/distributed_object_store/__init__.py +3 -1
- adapta/storage/distributed_object_store/v2/__init__.py +18 -0
- adapta/storage/distributed_object_store/{datastax_astra → v2/datastax_astra}/README.md +2 -0
- adapta/storage/distributed_object_store/v2/datastax_astra/__init__.py +20 -0
- adapta/storage/distributed_object_store/{datastax_astra → v2/datastax_astra}/_models.py +16 -0
- adapta/storage/distributed_object_store/{datastax_astra → v2/datastax_astra}/astra_client.py +61 -52
- adapta/storage/{database/models → distributed_object_store/v3}/__init__.py +4 -5
- adapta/storage/distributed_object_store/v3/datastax_astra/README.md +277 -0
- adapta/storage/distributed_object_store/v3/datastax_astra/__init__.py +20 -0
- adapta/storage/distributed_object_store/v3/datastax_astra/_model_mappers.py +469 -0
- adapta/storage/distributed_object_store/v3/datastax_astra/_models.py +134 -0
- adapta/storage/distributed_object_store/v3/datastax_astra/astra_client.py +569 -0
- adapta/storage/exceptions.py +1 -1
- adapta/storage/models/__init__.py +1 -1
- adapta/storage/models/_functions.py +5 -5
- adapta/storage/models/astra.py +4 -4
- adapta/storage/models/aws.py +1 -1
- adapta/storage/models/azure.py +2 -3
- adapta/storage/models/base.py +9 -1
- adapta/storage/models/enum.py +19 -0
- adapta/storage/models/filter_expression.py +124 -10
- adapta/storage/models/format.py +16 -205
- adapta/storage/models/formatters/__init__.py +36 -0
- adapta/storage/models/formatters/dict.py +43 -0
- adapta/storage/models/formatters/exceptions.py +7 -0
- adapta/storage/models/formatters/metaframe.py +48 -0
- adapta/storage/models/formatters/pandas.py +139 -0
- adapta/storage/models/formatters/pickle.py +36 -0
- adapta/storage/models/formatters/polars.py +240 -0
- adapta/storage/models/formatters/unit.py +26 -0
- adapta/storage/models/hive.py +24 -16
- adapta/storage/models/local.py +1 -1
- adapta/storage/models/trino.py +56 -0
- adapta/storage/query_enabled_store/README.md +1 -1
- adapta/storage/query_enabled_store/__init__.py +7 -1
- adapta/storage/query_enabled_store/_models.py +42 -13
- adapta/storage/query_enabled_store/_qes_astra.py +27 -14
- adapta/storage/query_enabled_store/_qes_delta.py +32 -10
- adapta/storage/query_enabled_store/_qes_local.py +81 -0
- adapta/storage/query_enabled_store/_qes_trino.py +133 -0
- adapta/storage/secrets/__init__.py +1 -1
- adapta/storage/secrets/_base.py +5 -4
- adapta/storage/secrets/azure_secret_client.py +3 -4
- adapta/storage/secrets/hashicorp_vault_secret_storage_client.py +5 -5
- adapta/utils/README.md +92 -0
- adapta/utils/__init__.py +2 -1
- adapta/utils/_common.py +50 -17
- adapta/utils/_requests.py +53 -0
- adapta/utils/concurrent_task_runner.py +10 -9
- adapta/utils/data_structures/_functions.py +6 -6
- adapta/utils/decorators/_logging.py +3 -3
- adapta/utils/decorators/_rate_limit.py +2 -2
- adapta/utils/metaframe.py +172 -0
- adapta/utils/python_typing/_functions.py +5 -10
- {adapta-2.11.9.dist-info → adapta-3.5.13.dist-info}/METADATA +18 -14
- adapta-3.5.13.dist-info/RECORD +146 -0
- {adapta-2.11.9.dist-info → adapta-3.5.13.dist-info}/WHEEL +1 -1
- adapta-2.11.9.dist-info/RECORD +0 -110
- {adapta-2.11.9.dist-info → adapta-3.5.13.dist-info/licenses}/LICENSE +0 -0
adapta/__init__.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Global index.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
# Copyright (c) 2023-
|
|
5
|
+
# Copyright (c) 2023-2026. ECCO Data & AI and other project contributors.
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
adapta/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '
|
|
1
|
+
__version__ = '3.5.13'
|
adapta/connectors/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""init file"""
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2023-
|
|
3
|
+
# Copyright (c) 2023-2026. ECCO Data & AI and other project contributors.
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Connector for Azure Service Bus.
|
|
3
3
|
"""
|
|
4
|
-
# Copyright (c) 2023-
|
|
4
|
+
# Copyright (c) 2023-2026. ECCO Data & AI and other project contributors.
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
# limitations under the License.
|
|
17
17
|
#
|
|
18
18
|
|
|
19
|
-
from typing import Optional
|
|
20
19
|
import os
|
|
21
20
|
from azure.servicebus import (
|
|
22
21
|
ServiceBusSender,
|
|
@@ -31,7 +30,7 @@ class AzureServiceBusConnector:
|
|
|
31
30
|
Connector for Azure Service Bus.
|
|
32
31
|
"""
|
|
33
32
|
|
|
34
|
-
def __init__(self, conn_str:
|
|
33
|
+
def __init__(self, conn_str: str | None = None, queue_name: str | None = None):
|
|
35
34
|
self.service_bus_client: ServiceBusClient = ServiceBusClient.from_connection_string(
|
|
36
35
|
conn_str=conn_str if conn_str is not None else os.environ["SERVICE_BUS_CONNECTION_STRING"],
|
|
37
36
|
transport_type=TransportType.Amqp,
|
adapta/logs/__init__.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Module index.
|
|
3
3
|
"""
|
|
4
|
-
# Copyright (c) 2023-
|
|
4
|
+
# Copyright (c) 2023-2026. ECCO Data & AI and other project contributors.
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
adapta/logs/_async_logger.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"""
|
|
4
4
|
import asyncio
|
|
5
5
|
|
|
6
|
-
# Copyright (c) 2023-
|
|
6
|
+
# Copyright (c) 2023-2026. ECCO Data & AI and other project contributors.
|
|
7
7
|
#
|
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
9
|
# you may not use this file except in compliance with the License.
|
|
@@ -19,11 +19,12 @@ import asyncio
|
|
|
19
19
|
#
|
|
20
20
|
|
|
21
21
|
import logging
|
|
22
|
+
import sys
|
|
22
23
|
import threading
|
|
23
24
|
from contextlib import asynccontextmanager
|
|
24
25
|
from logging.handlers import QueueHandler, QueueListener
|
|
25
|
-
from
|
|
26
|
-
from typing import final, TypeVar, Generic
|
|
26
|
+
from queue import Queue
|
|
27
|
+
from typing import final, TypeVar, Generic
|
|
27
28
|
|
|
28
29
|
from adapta.logs._internal import MetadataLogger
|
|
29
30
|
from adapta.logs._internal_logger import _InternalLogger
|
|
@@ -38,11 +39,11 @@ class _AsyncLogger(Generic[TLogger], _InternalLogger):
|
|
|
38
39
|
Asyncio-safe wrapper for MetadataLogger
|
|
39
40
|
"""
|
|
40
41
|
|
|
41
|
-
def redirect(self, tags:
|
|
42
|
+
def redirect(self, tags: dict[str, str] | None = None, **kwargs):
|
|
42
43
|
return self._redirect(logger=self._logger, tags=tags)
|
|
43
44
|
|
|
44
45
|
@asynccontextmanager
|
|
45
|
-
async def redirect_async(self, tags:
|
|
46
|
+
async def redirect_async(self, tags: dict[str, str] | None = None, **kwargs):
|
|
46
47
|
is_active = False
|
|
47
48
|
tmp_symlink_out = b""
|
|
48
49
|
tmp_symlink_err = b""
|
|
@@ -57,16 +58,26 @@ class _AsyncLogger(Generic[TLogger], _InternalLogger):
|
|
|
57
58
|
# externally control the flushing process
|
|
58
59
|
while is_active:
|
|
59
60
|
start_position_out = self._flush_and_log(
|
|
60
|
-
pos=start_position_out,
|
|
61
|
+
pos=start_position_out,
|
|
62
|
+
tmp_symlink=tmp_symlink_out,
|
|
63
|
+
logger=self._logger,
|
|
64
|
+
tags=tags,
|
|
65
|
+
channel=sys.stdout,
|
|
61
66
|
)
|
|
62
67
|
start_position_err = self._flush_and_log(
|
|
63
|
-
pos=start_position_err,
|
|
68
|
+
pos=start_position_err,
|
|
69
|
+
tmp_symlink=tmp_symlink_err,
|
|
70
|
+
logger=self._logger,
|
|
71
|
+
tags=tags,
|
|
72
|
+
channel=sys.stderr,
|
|
64
73
|
)
|
|
65
74
|
await asyncio.sleep(0.1)
|
|
66
75
|
|
|
67
76
|
return self._flush_and_log(
|
|
68
|
-
pos=start_position_out, tmp_symlink=tmp_symlink_out, logger=self._logger, tags=tags
|
|
69
|
-
), self._flush_and_log(
|
|
77
|
+
pos=start_position_out, tmp_symlink=tmp_symlink_out, logger=self._logger, tags=tags, channel=sys.stdout
|
|
78
|
+
), self._flush_and_log(
|
|
79
|
+
pos=start_position_err, tmp_symlink=tmp_symlink_err, logger=self._logger, tags=tags, channel=sys.stderr
|
|
80
|
+
)
|
|
70
81
|
|
|
71
82
|
self._handle_unsupported_redirect(tags)
|
|
72
83
|
libc, saved_stdout, saved_stderr, tmp_file_out, tmp_file_err = self._prepare_redirect()
|
|
@@ -86,25 +97,26 @@ class _AsyncLogger(Generic[TLogger], _InternalLogger):
|
|
|
86
97
|
self,
|
|
87
98
|
name: str,
|
|
88
99
|
min_log_level: LogLevel,
|
|
89
|
-
log_handlers:
|
|
90
|
-
fixed_template:
|
|
100
|
+
log_handlers: list[logging.Handler],
|
|
101
|
+
fixed_template: dict[str, dict[str, str]] | None = None,
|
|
91
102
|
fixed_template_delimiter=", ",
|
|
103
|
+
global_tags: dict[str, str] | None = None,
|
|
92
104
|
):
|
|
93
|
-
super().__init__(fixed_template, fixed_template_delimiter)
|
|
105
|
+
super().__init__(fixed_template, fixed_template_delimiter, global_tags)
|
|
94
106
|
self._logger: MetadataLogger = logging.getLogger(name)
|
|
95
107
|
self._logger.setLevel(min_log_level.value)
|
|
96
108
|
self._logger_message_queue = Queue(-1)
|
|
97
109
|
self._logger_queue_handler = QueueHandler(self._logger_message_queue)
|
|
98
110
|
self._logger.addHandler(self._logger_queue_handler)
|
|
99
111
|
self._log_handlers = log_handlers
|
|
100
|
-
self._listener:
|
|
112
|
+
self._listener: QueueListener | None = None
|
|
101
113
|
self._is_active: bool = False
|
|
102
114
|
self._lock = threading.RLock()
|
|
103
115
|
|
|
104
116
|
def info(
|
|
105
117
|
self,
|
|
106
118
|
template: str,
|
|
107
|
-
tags:
|
|
119
|
+
tags: dict[str, str] | None = None,
|
|
108
120
|
**kwargs,
|
|
109
121
|
) -> None:
|
|
110
122
|
"""
|
|
@@ -120,8 +132,8 @@ class _AsyncLogger(Generic[TLogger], _InternalLogger):
|
|
|
120
132
|
def warning(
|
|
121
133
|
self,
|
|
122
134
|
template: str,
|
|
123
|
-
exception:
|
|
124
|
-
tags:
|
|
135
|
+
exception: BaseException | None = None,
|
|
136
|
+
tags: dict[str, str] | None = None,
|
|
125
137
|
**kwargs,
|
|
126
138
|
) -> None:
|
|
127
139
|
"""
|
|
@@ -138,8 +150,8 @@ class _AsyncLogger(Generic[TLogger], _InternalLogger):
|
|
|
138
150
|
def error(
|
|
139
151
|
self,
|
|
140
152
|
template: str,
|
|
141
|
-
exception:
|
|
142
|
-
tags:
|
|
153
|
+
exception: BaseException | None = None,
|
|
154
|
+
tags: dict[str, str] | None = None,
|
|
143
155
|
**kwargs,
|
|
144
156
|
) -> None:
|
|
145
157
|
"""
|
|
@@ -156,9 +168,9 @@ class _AsyncLogger(Generic[TLogger], _InternalLogger):
|
|
|
156
168
|
def debug(
|
|
157
169
|
self,
|
|
158
170
|
template: str,
|
|
159
|
-
exception:
|
|
160
|
-
diagnostics:
|
|
161
|
-
tags:
|
|
171
|
+
exception: BaseException | None = None,
|
|
172
|
+
diagnostics: str | None = None, # pylint: disable=R0913
|
|
173
|
+
tags: dict[str, str] | None = None,
|
|
162
174
|
**kwargs,
|
|
163
175
|
) -> None:
|
|
164
176
|
"""
|
|
@@ -205,11 +217,12 @@ class _AsyncLogger(Generic[TLogger], _InternalLogger):
|
|
|
205
217
|
|
|
206
218
|
|
|
207
219
|
def create_async_logger(
|
|
208
|
-
logger_type:
|
|
209
|
-
log_handlers:
|
|
220
|
+
logger_type: type[TLogger],
|
|
221
|
+
log_handlers: list[logging.Handler],
|
|
210
222
|
min_log_level: LogLevel = LogLevel.INFO,
|
|
211
|
-
fixed_template:
|
|
223
|
+
fixed_template: dict[str, dict[str, str]] | None = None,
|
|
212
224
|
fixed_template_delimiter=", ",
|
|
225
|
+
global_tags: dict[str, str] = None,
|
|
213
226
|
) -> _AsyncLogger[TLogger]:
|
|
214
227
|
"""
|
|
215
228
|
Factory method to create an async-io safe logger.
|
|
@@ -222,4 +235,5 @@ def create_async_logger(
|
|
|
222
235
|
log_handlers=log_handlers,
|
|
223
236
|
fixed_template=fixed_template,
|
|
224
237
|
fixed_template_delimiter=fixed_template_delimiter,
|
|
238
|
+
global_tags=global_tags,
|
|
225
239
|
)
|
adapta/logs/_base.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Adapta Logging Interface.
|
|
3
3
|
"""
|
|
4
|
-
# Copyright (c) 2023-
|
|
4
|
+
# Copyright (c) 2023-2026. ECCO Data & AI and other project contributors.
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import logging
|
|
20
20
|
from logging import Handler, StreamHandler
|
|
21
|
-
from typing import
|
|
21
|
+
from typing import final
|
|
22
22
|
|
|
23
23
|
from adapta.logs._internal_logger import _InternalLogger
|
|
24
24
|
from adapta.logs.models import LogLevel
|
|
@@ -31,10 +31,10 @@ class SemanticLogger(_InternalLogger):
|
|
|
31
31
|
Proxy for a collection of python loggers that use the same formatting interface.
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
|
-
async def redirect_async(self, tags:
|
|
34
|
+
async def redirect_async(self, tags: dict[str, str] | None = None, **kwargs):
|
|
35
35
|
raise NotImplementedError("Async operations are not supported by this logger")
|
|
36
36
|
|
|
37
|
-
def redirect(self, tags:
|
|
37
|
+
def redirect(self, tags: dict[str, str] | None = None, log_source_name: str | None = None, **kwargs):
|
|
38
38
|
return self._redirect(logger=self._get_logger(log_source_name), tags=tags)
|
|
39
39
|
|
|
40
40
|
def start(self) -> None:
|
|
@@ -43,7 +43,7 @@ class SemanticLogger(_InternalLogger):
|
|
|
43
43
|
def stop(self) -> None:
|
|
44
44
|
pass
|
|
45
45
|
|
|
46
|
-
def __init__(self, fixed_template:
|
|
46
|
+
def __init__(self, fixed_template: dict[str, dict[str, str]] | None = None, fixed_template_delimiter=", "):
|
|
47
47
|
"""
|
|
48
48
|
Creates a new instance of a SemanticLogger
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ class SemanticLogger(_InternalLogger):
|
|
|
51
51
|
:param fixed_template_delimiter: Optional delimiter to use when appending fixed templates.
|
|
52
52
|
"""
|
|
53
53
|
super().__init__(fixed_template, fixed_template_delimiter)
|
|
54
|
-
self._loggers:
|
|
54
|
+
self._loggers: dict[str, logging.Logger] = {}
|
|
55
55
|
self._default_log_source = None
|
|
56
56
|
self._fixed_template = fixed_template
|
|
57
57
|
self._fixed_template_delimiter = fixed_template_delimiter
|
|
@@ -62,7 +62,7 @@ class SemanticLogger(_InternalLogger):
|
|
|
62
62
|
*,
|
|
63
63
|
log_source_name: str,
|
|
64
64
|
min_log_level: LogLevel,
|
|
65
|
-
log_handlers:
|
|
65
|
+
log_handlers: list[Handler] | None = None,
|
|
66
66
|
is_default=False,
|
|
67
67
|
) -> "SemanticLogger":
|
|
68
68
|
"""
|
|
@@ -90,13 +90,13 @@ class SemanticLogger(_InternalLogger):
|
|
|
90
90
|
|
|
91
91
|
return self
|
|
92
92
|
|
|
93
|
-
def __getattr__(self, log_source) ->
|
|
93
|
+
def __getattr__(self, log_source) -> logging.Logger | None:
|
|
94
94
|
if log_source in self._loggers:
|
|
95
95
|
return self._loggers[log_source]
|
|
96
96
|
|
|
97
97
|
return None
|
|
98
98
|
|
|
99
|
-
def _get_logger(self, log_source_name:
|
|
99
|
+
def _get_logger(self, log_source_name: str | None = None) -> MetadataLogger:
|
|
100
100
|
"""
|
|
101
101
|
Retrieves a logger by log source name, or a default logger is log source name is not provided.
|
|
102
102
|
|
|
@@ -117,8 +117,8 @@ class SemanticLogger(_InternalLogger):
|
|
|
117
117
|
def info(
|
|
118
118
|
self,
|
|
119
119
|
template: str,
|
|
120
|
-
tags:
|
|
121
|
-
log_source_name:
|
|
120
|
+
tags: dict[str, str] | None = None,
|
|
121
|
+
log_source_name: str | None = None,
|
|
122
122
|
**kwargs,
|
|
123
123
|
) -> None:
|
|
124
124
|
"""
|
|
@@ -136,9 +136,9 @@ class SemanticLogger(_InternalLogger):
|
|
|
136
136
|
def warning(
|
|
137
137
|
self,
|
|
138
138
|
template: str,
|
|
139
|
-
exception:
|
|
140
|
-
tags:
|
|
141
|
-
log_source_name:
|
|
139
|
+
exception: BaseException | None = None,
|
|
140
|
+
tags: dict[str, str] | None = None,
|
|
141
|
+
log_source_name: str | None = None,
|
|
142
142
|
**kwargs,
|
|
143
143
|
) -> None:
|
|
144
144
|
"""
|
|
@@ -157,9 +157,9 @@ class SemanticLogger(_InternalLogger):
|
|
|
157
157
|
def error(
|
|
158
158
|
self,
|
|
159
159
|
template: str,
|
|
160
|
-
exception:
|
|
161
|
-
tags:
|
|
162
|
-
log_source_name:
|
|
160
|
+
exception: BaseException | None = None,
|
|
161
|
+
tags: dict[str, str] | None = None,
|
|
162
|
+
log_source_name: str | None = None,
|
|
163
163
|
**kwargs,
|
|
164
164
|
) -> None:
|
|
165
165
|
"""
|
|
@@ -178,10 +178,10 @@ class SemanticLogger(_InternalLogger):
|
|
|
178
178
|
def debug(
|
|
179
179
|
self,
|
|
180
180
|
template: str,
|
|
181
|
-
exception:
|
|
182
|
-
diagnostics:
|
|
183
|
-
tags:
|
|
184
|
-
log_source_name:
|
|
181
|
+
exception: BaseException | None = None,
|
|
182
|
+
diagnostics: str | None = None, # pylint: disable=R0913
|
|
183
|
+
tags: dict[str, str] | None = None,
|
|
184
|
+
log_source_name: str | None = None,
|
|
185
185
|
**kwargs,
|
|
186
186
|
) -> None:
|
|
187
187
|
"""
|
adapta/logs/_internal.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""Classes for internal use by `adapta.logs` module. Should not be imported outside this module"""
|
|
2
|
-
# Copyright (c) 2023-
|
|
2
|
+
# Copyright (c) 2023-2026. ECCO Data & AI and other project contributors.
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
#
|
|
16
16
|
|
|
17
17
|
import logging
|
|
18
|
-
from typing import Optional, Dict
|
|
19
18
|
|
|
20
19
|
from adapta.logs.models import CompositeLogMetadata, LogLevel
|
|
21
20
|
|
|
@@ -39,11 +38,11 @@ class MetadataLogger(logging.Logger):
|
|
|
39
38
|
log_level: int,
|
|
40
39
|
msg: str,
|
|
41
40
|
template: str,
|
|
42
|
-
tags:
|
|
43
|
-
diagnostics:
|
|
41
|
+
tags: dict[str, str] | None,
|
|
42
|
+
diagnostics: str | None,
|
|
44
43
|
stack_info: bool,
|
|
45
|
-
metadata_fields:
|
|
46
|
-
exception:
|
|
44
|
+
metadata_fields: dict[str, str] | None,
|
|
45
|
+
exception: BaseException | None,
|
|
47
46
|
):
|
|
48
47
|
"""
|
|
49
48
|
Creates log entry with metadata from Composite Logger
|
|
@@ -77,7 +76,7 @@ class MetadataLogger(logging.Logger):
|
|
|
77
76
|
)
|
|
78
77
|
|
|
79
78
|
|
|
80
|
-
def from_log_level(log_level:
|
|
79
|
+
def from_log_level(log_level: LogLevel | None) -> int | None:
|
|
81
80
|
"""
|
|
82
81
|
Converts adapta log level to logging log level
|
|
83
82
|
"""
|