omnata-plugin-runtime 0.5.3__tar.gz → 0.5.4__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/PKG-INFO +1 -1
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/pyproject.toml +1 -1
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/configuration.py +8 -1
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/forms.py +1 -1
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/omnata_plugin.py +24 -17
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/LICENSE +0 -0
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/README.md +0 -0
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/__init__.py +0 -0
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/api.py +0 -0
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/logging.py +0 -0
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/plugin_entrypoints.py +0 -0
- {omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/rate_limiting.py +0 -0
@@ -8,7 +8,7 @@ from typing import Any, List, Dict, Literal, Union, Optional
|
|
8
8
|
from enum import Enum
|
9
9
|
|
10
10
|
from abc import ABC
|
11
|
-
from pydantic import BaseModel, Field, PrivateAttr, SerializationInfo, model_serializer, validator # pylint: disable=no-name-in-module
|
11
|
+
from pydantic import BaseModel, Field, PrivateAttr, SerializationInfo, field_validator, model_serializer, validator # pylint: disable=no-name-in-module
|
12
12
|
|
13
13
|
if tuple(sys.version_info[:2]) >= (3, 9):
|
14
14
|
# Python 3.9 and above
|
@@ -449,6 +449,13 @@ class StoredStreamConfiguration(SubscriptableBaseModel):
|
|
449
449
|
stream: StreamConfiguration
|
450
450
|
latest_state: dict = Field(default_factory=dict,description="The latest state of the stream, used for incremental syncs")
|
451
451
|
|
452
|
+
@field_validator('latest_state',mode='before')
|
453
|
+
@classmethod
|
454
|
+
def state_must_not_be_none(cls, v: Optional[dict]) -> dict:
|
455
|
+
if v is None:
|
456
|
+
return {}
|
457
|
+
return v
|
458
|
+
|
452
459
|
|
453
460
|
class StreamConfiguration(SubscriptableBaseModel):
|
454
461
|
"""
|
{omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/forms.py
RENAMED
@@ -209,7 +209,7 @@ class FormSliderField(SubscriptableBaseModel):
|
|
209
209
|
|
210
210
|
name: str
|
211
211
|
label: str
|
212
|
-
default_value: Optional[str] = Field(default=None)
|
212
|
+
default_value: Optional[Union[str,int]] = Field(default=None)
|
213
213
|
secret: bool = Field(default=False)
|
214
214
|
required: bool = Field(default=False)
|
215
215
|
depends_on: Optional[str] = Field(default=None)
|
@@ -1007,20 +1007,23 @@ class InboundSyncRequest(SyncRequest):
|
|
1007
1007
|
"""
|
1008
1008
|
Sends a message to the plugin with the current progress of the sync run, if it has changed since last time.
|
1009
1009
|
"""
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1010
|
+
if self._apply_results is not None:
|
1011
|
+
with self._apply_results_lock:
|
1012
|
+
new_progress_update = PluginMessageStreamProgressUpdate(
|
1013
|
+
stream_total_counts=self._stream_record_counts,
|
1014
|
+
# records could have been marked as completed, but still have results to apply
|
1015
|
+
completed_streams=[s for s in self._completed_streams if s not in self._apply_results or self._apply_results[s] is None],
|
1016
|
+
stream_errors=self._omnata_log_handler.stream_global_errors,
|
1017
|
+
total_records_estimate=self._total_records_estimate
|
1018
|
+
)
|
1019
|
+
if self._last_stream_progress_update is None or new_progress_update != self._last_stream_progress_update:
|
1020
|
+
result = self._plugin_message(
|
1021
|
+
message=new_progress_update,
|
1022
|
+
ignore_errors=ignore_errors
|
1023
|
+
)
|
1024
|
+
if result is None:
|
1025
|
+
return False
|
1026
|
+
self._last_stream_progress_update = new_progress_update
|
1024
1027
|
return True
|
1025
1028
|
|
1026
1029
|
def apply_cancellation(self):
|
@@ -2042,9 +2045,13 @@ def __managed_inbound_processing_worker(
|
|
2042
2045
|
# restore the first argument, was originally the dataframe/generator but now it's the appropriately sized dataframe
|
2043
2046
|
try:
|
2044
2047
|
logger.info(f"worker {worker_index} processing stream {stream.stream_name}, invoking plugin class method {method.__name__}")
|
2045
|
-
method(plugin_class_obj, *(stream, *method_args), **method_kwargs)
|
2046
|
-
logger.info(f"worker {worker_index} completed processing stream {stream.stream_name}
|
2047
|
-
|
2048
|
+
result = method(plugin_class_obj, *(stream, *method_args), **method_kwargs)
|
2049
|
+
logger.info(f"worker {worker_index} completed processing stream {stream.stream_name}")
|
2050
|
+
if result is not None and result is False:
|
2051
|
+
logger.info(f"worker {worker_index} requested that {stream.stream_name} be not marked as complete")
|
2052
|
+
else:
|
2053
|
+
logger.info(f"worker {worker_index} marking stream {stream.stream_name} as complete")
|
2054
|
+
plugin_class_obj._sync_request.mark_stream_complete(stream.stream_name)
|
2048
2055
|
except InterruptedWhileWaitingException:
|
2049
2056
|
# If an inbound run is cancelled while waiting for rate limiting, this should mean that
|
2050
2057
|
# the cancellation is handled elsewhere, so we don't need to do anything special here other than stop waiting
|
File without changes
|
File without changes
|
{omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/__init__.py
RENAMED
File without changes
|
{omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/api.py
RENAMED
File without changes
|
{omnata_plugin_runtime-0.5.3 → omnata_plugin_runtime-0.5.4}/src/omnata_plugin_runtime/logging.py
RENAMED
File without changes
|
File without changes
|
File without changes
|