omnata-plugin-runtime 0.8.0a186__py3-none-any.whl → 0.8.0a187__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omnata_plugin_runtime/configuration.py +1 -2
- omnata_plugin_runtime/plugin_entrypoints.py +28 -4
- omnata_plugin_runtime/rate_limiting.py +1 -2
- {omnata_plugin_runtime-0.8.0a186.dist-info → omnata_plugin_runtime-0.8.0a187.dist-info}/METADATA +1 -1
- omnata_plugin_runtime-0.8.0a187.dist-info/RECORD +12 -0
- omnata_plugin_runtime-0.8.0a186.dist-info/RECORD +0 -12
- {omnata_plugin_runtime-0.8.0a186.dist-info → omnata_plugin_runtime-0.8.0a187.dist-info}/LICENSE +0 -0
- {omnata_plugin_runtime-0.8.0a186.dist-info → omnata_plugin_runtime-0.8.0a187.dist-info}/WHEEL +0 -0
@@ -11,6 +11,7 @@ from enum import Enum
|
|
11
11
|
|
12
12
|
from abc import ABC
|
13
13
|
from pydantic import BaseModel, Field, PrivateAttr, SerializationInfo, TypeAdapter, field_validator, model_serializer, validator # pylint: disable=no-name-in-module
|
14
|
+
from .logging import logger
|
14
15
|
|
15
16
|
if tuple(sys.version_info[:2]) >= (3, 9):
|
16
17
|
# Python 3.9 and above
|
@@ -19,8 +20,6 @@ else:
|
|
19
20
|
# Python 3.8 and below
|
20
21
|
from typing_extensions import Annotated
|
21
22
|
|
22
|
-
logger = logging.getLogger(__name__)
|
23
|
-
|
24
23
|
|
25
24
|
class MapperType(str, Enum):
|
26
25
|
FIELD_MAPPING_SELECTOR = "field_mapping_selector"
|
@@ -24,7 +24,7 @@ from .configuration import (
|
|
24
24
|
ConnectivityOption
|
25
25
|
)
|
26
26
|
from .forms import ConnectionMethod, FormInputField, FormOption
|
27
|
-
from .logging import OmnataPluginLogHandler
|
27
|
+
from .logging import OmnataPluginLogHandler, logger
|
28
28
|
from .omnata_plugin import (
|
29
29
|
SnowflakeBillingEvent,
|
30
30
|
BillingEventRequest,
|
@@ -37,9 +37,6 @@ from .omnata_plugin import (
|
|
37
37
|
from pydantic import TypeAdapter
|
38
38
|
from .rate_limiting import ApiLimits, RateLimitState
|
39
39
|
|
40
|
-
# set the logger class to our custom logger so that pydantic errors are handled correctly
|
41
|
-
logger = logging.getLogger(__name__)
|
42
|
-
|
43
40
|
IMPORT_DIRECTORY_NAME = "snowflake_import_directory"
|
44
41
|
|
45
42
|
|
@@ -93,6 +90,14 @@ class PluginEntrypoint:
|
|
93
90
|
connection_id=request.connection_id,
|
94
91
|
sync_run_id=request.run_id,
|
95
92
|
)
|
93
|
+
logger.add_extra('omnata.operation', 'sync')
|
94
|
+
logger.add_extra('omnata.sync.id', request.sync_id)
|
95
|
+
logger.add_extra('omnata.sync.direction', request.sync_direction)
|
96
|
+
logger.add_extra('omnata.connection.id', request.connection_id)
|
97
|
+
logger.add_extra('omnata.sync.run_id', request.run_id)
|
98
|
+
logger.add_extra('omnata.sync_branch.id', request.sync_branch_id)
|
99
|
+
logger.add_extra('omnata.sync_branch.name', request.sync_branch_name)
|
100
|
+
|
96
101
|
omnata_log_handler.register(
|
97
102
|
request.logging_level, self._plugin_instance.additional_loggers()
|
98
103
|
)
|
@@ -283,6 +288,12 @@ class PluginEntrypoint:
|
|
283
288
|
sync_parameters: Dict,
|
284
289
|
current_form_parameters: Optional[Dict],
|
285
290
|
):
|
291
|
+
logger.add_extra('omnata.operation', 'configuration_form')
|
292
|
+
logger.add_extra('omnata.connection.connectivity_option', connectivity_option)
|
293
|
+
logger.add_extra('omnata.connection.connection_method', connection_method)
|
294
|
+
logger.add_extra('omnata.configuration_form.function_name', function_name)
|
295
|
+
logger.add_extra('omnata.sync.direction', sync_direction)
|
296
|
+
|
286
297
|
logger.info("Entered configuration_form method")
|
287
298
|
sync_strategy = normalise_nulls(sync_strategy)
|
288
299
|
oauth_secret_name = normalise_nulls(oauth_secret_name)
|
@@ -342,6 +353,10 @@ class PluginEntrypoint:
|
|
342
353
|
sync_parameters: Dict,
|
343
354
|
selected_streams: Optional[List[str]], # None to return all streams without requiring schema
|
344
355
|
):
|
356
|
+
logger.add_extra('omnata.operation', 'list_streams')
|
357
|
+
logger.add_extra('omnata.connection.connectivity_option', connectivity_option)
|
358
|
+
logger.add_extra('omnata.connection.connection_method', connection_method)
|
359
|
+
logger.add_extra('omnata.sync.direction', 'inbound')
|
345
360
|
logger.debug("Entered list_streams method")
|
346
361
|
oauth_secret_name = normalise_nulls(oauth_secret_name)
|
347
362
|
other_secrets_name = normalise_nulls(other_secrets_name)
|
@@ -393,6 +408,8 @@ class PluginEntrypoint:
|
|
393
408
|
return results
|
394
409
|
|
395
410
|
def connection_form(self,connectivity_option: str):
|
411
|
+
logger.add_extra('omnata.operation', 'connection_form')
|
412
|
+
logger.add_extra('omnata.connection.connectivity_option', connectivity_option)
|
396
413
|
connectivity_option = TypeAdapter(ConnectivityOption).validate_python(connectivity_option)
|
397
414
|
logger.info("Entered connection_form method")
|
398
415
|
if self._plugin_instance.connection_form.__code__.co_argcount==1:
|
@@ -402,6 +419,7 @@ class PluginEntrypoint:
|
|
402
419
|
return [f.model_dump() for f in form]
|
403
420
|
|
404
421
|
def create_billing_events(self, session, event_request: Dict):
|
422
|
+
logger.add_extra('omnata.operation', 'create_billing_events')
|
405
423
|
logger.info("Entered create_billing_events method")
|
406
424
|
request = TypeAdapter(BillingEventRequest).validate_python(event_request)
|
407
425
|
events: List[SnowflakeBillingEvent] = self._plugin_instance.create_billing_events(
|
@@ -474,6 +492,9 @@ class PluginEntrypoint:
|
|
474
492
|
oauth_secret_name: Optional[str],
|
475
493
|
other_secrets_name: Optional[str],
|
476
494
|
):
|
495
|
+
logger.add_extra('omnata.operation', 'connection_test')
|
496
|
+
logger.add_extra('omnata.connection.connectivity_option', connectivity_option)
|
497
|
+
logger.add_extra('omnata.connection.connection_method', method)
|
477
498
|
logger.info("Entered connect method")
|
478
499
|
logger.info(f"Connection parameters: {connection_parameters}")
|
479
500
|
connection_secrets = get_secrets(oauth_secret_name, other_secrets_name)
|
@@ -524,6 +545,9 @@ class PluginEntrypoint:
|
|
524
545
|
connection_parameters: Dict,
|
525
546
|
oauth_secret_name: Optional[str],
|
526
547
|
other_secrets_name: Optional[str]):
|
548
|
+
logger.add_extra('omnata.operation', 'api_limits')
|
549
|
+
logger.add_extra('omnata.connection.connectivity_option', connectivity_option)
|
550
|
+
logger.add_extra('omnata.connection.connection_method', method)
|
527
551
|
logger.info("Entered api_limits method")
|
528
552
|
connection_secrets = get_secrets(oauth_secret_name, other_secrets_name)
|
529
553
|
from omnata_plugin_runtime.omnata_plugin import (
|
@@ -15,12 +15,11 @@ import logging
|
|
15
15
|
from pydantic import Field, root_validator, PrivateAttr, field_serializer
|
16
16
|
from pydantic_core import to_jsonable_python
|
17
17
|
from .configuration import SubscriptableBaseModel
|
18
|
+
from .logging import logger
|
18
19
|
import pytz
|
19
20
|
from requests.adapters import HTTPAdapter
|
20
21
|
from urllib3.util.retry import Retry
|
21
22
|
|
22
|
-
logger = getLogger(__name__)
|
23
|
-
|
24
23
|
TimeUnitType = Literal["second", "minute", "hour", "day"]
|
25
24
|
|
26
25
|
HttpMethodType = Literal[
|
@@ -0,0 +1,12 @@
|
|
1
|
+
omnata_plugin_runtime/__init__.py,sha256=MS9d1whnfT_B3-ThqZ7l63QeC_8OEKTuaYV5wTwRpBA,1576
|
2
|
+
omnata_plugin_runtime/api.py,sha256=tVi4KLL0v5N3yz3Ie0kSyFemryu572gCbtSRfWN6wBU,6523
|
3
|
+
omnata_plugin_runtime/configuration.py,sha256=5M7dmQu9BO2msES9Foa8fOKfWui7iPSExAJdj9TeI98,38329
|
4
|
+
omnata_plugin_runtime/forms.py,sha256=ueodN2GIMS5N9fqebpY4uNGJnjEb9HcuaVQVfWH-cGg,19838
|
5
|
+
omnata_plugin_runtime/logging.py,sha256=u_Bo2v4jS3C_2E_Y8a7yfZZcIP-h5Mak_FPnFHUwFbU,4378
|
6
|
+
omnata_plugin_runtime/omnata_plugin.py,sha256=aggjb_CTTjhgqjS8CHPOm4ENU0jNcYoT6LC8yI1IeF4,130048
|
7
|
+
omnata_plugin_runtime/plugin_entrypoints.py,sha256=LM4FHMW0N3N13oxsUqkSEbUhH95uFw-yNIJ5kNGDgWE,30633
|
8
|
+
omnata_plugin_runtime/rate_limiting.py,sha256=JKtyz8mA9D0FSZgQplPusmk2rVclcjkwtE59fQQrQ_I,25610
|
9
|
+
omnata_plugin_runtime-0.8.0a187.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
|
10
|
+
omnata_plugin_runtime-0.8.0a187.dist-info/METADATA,sha256=uVZoK32EmYnNrEAi7mDHt6x9iVZ2IvrBXWBqpmmbNeo,2148
|
11
|
+
omnata_plugin_runtime-0.8.0a187.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
12
|
+
omnata_plugin_runtime-0.8.0a187.dist-info/RECORD,,
|
@@ -1,12 +0,0 @@
|
|
1
|
-
omnata_plugin_runtime/__init__.py,sha256=MS9d1whnfT_B3-ThqZ7l63QeC_8OEKTuaYV5wTwRpBA,1576
|
2
|
-
omnata_plugin_runtime/api.py,sha256=tVi4KLL0v5N3yz3Ie0kSyFemryu572gCbtSRfWN6wBU,6523
|
3
|
-
omnata_plugin_runtime/configuration.py,sha256=Yyz3trj7G6nh3JyEw6S5qlrXUfS_MB-vZgATcNdWzp0,38339
|
4
|
-
omnata_plugin_runtime/forms.py,sha256=ueodN2GIMS5N9fqebpY4uNGJnjEb9HcuaVQVfWH-cGg,19838
|
5
|
-
omnata_plugin_runtime/logging.py,sha256=u_Bo2v4jS3C_2E_Y8a7yfZZcIP-h5Mak_FPnFHUwFbU,4378
|
6
|
-
omnata_plugin_runtime/omnata_plugin.py,sha256=aggjb_CTTjhgqjS8CHPOm4ENU0jNcYoT6LC8yI1IeF4,130048
|
7
|
-
omnata_plugin_runtime/plugin_entrypoints.py,sha256=spCatkTxRX0WAgX0wqZP_vUF4Z-uOF8SrASuO3HXT1o,28937
|
8
|
-
omnata_plugin_runtime/rate_limiting.py,sha256=JukA0l7x7Klqz2b54mR-poP7NRxpUHgWSGp6h0B8u6Q,25612
|
9
|
-
omnata_plugin_runtime-0.8.0a186.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
|
10
|
-
omnata_plugin_runtime-0.8.0a186.dist-info/METADATA,sha256=WKzsrVmekpQkDTx8mpKCEj67DG0FTtjFWqrJCbwEsXo,2148
|
11
|
-
omnata_plugin_runtime-0.8.0a186.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
12
|
-
omnata_plugin_runtime-0.8.0a186.dist-info/RECORD,,
|
{omnata_plugin_runtime-0.8.0a186.dist-info → omnata_plugin_runtime-0.8.0a187.dist-info}/LICENSE
RENAMED
File without changes
|
{omnata_plugin_runtime-0.8.0a186.dist-info → omnata_plugin_runtime-0.8.0a187.dist-info}/WHEEL
RENAMED
File without changes
|