omnata-plugin-runtime 0.3.24a73__py3-none-any.whl → 0.3.24a75__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omnata_plugin_runtime/omnata_plugin.py +9 -8
- omnata_plugin_runtime/plugin_entrypoints.py +5 -4
- {omnata_plugin_runtime-0.3.24a73.dist-info → omnata_plugin_runtime-0.3.24a75.dist-info}/METADATA +1 -1
- {omnata_plugin_runtime-0.3.24a73.dist-info → omnata_plugin_runtime-0.3.24a75.dist-info}/RECORD +6 -6
- {omnata_plugin_runtime-0.3.24a73.dist-info → omnata_plugin_runtime-0.3.24a75.dist-info}/LICENSE +0 -0
- {omnata_plugin_runtime-0.3.24a73.dist-info → omnata_plugin_runtime-0.3.24a75.dist-info}/WHEEL +0 -0
@@ -215,6 +215,7 @@ class SyncRequest(ABC):
|
|
215
215
|
self._apply_results_task = None
|
216
216
|
self._cancel_checking_task = None
|
217
217
|
self._rate_limit_update_task = None
|
218
|
+
self._last_stream_progress_update = None
|
218
219
|
|
219
220
|
threading.excepthook = self.thread_exception_hook
|
220
221
|
if self.development_mode is False:
|
@@ -301,7 +302,7 @@ class SyncRequest(ABC):
|
|
301
302
|
self.apply_cancellation()
|
302
303
|
except Exception as e:
|
303
304
|
logger.error(f"Error checking cancellation: {e}")
|
304
|
-
cancellation_token.wait(
|
305
|
+
cancellation_token.wait(20)
|
305
306
|
logger.info("cancel checking worker exiting")
|
306
307
|
|
307
308
|
@abstractmethod
|
@@ -949,16 +950,18 @@ class InboundSyncRequest(SyncRequest):
|
|
949
950
|
|
950
951
|
def apply_progress_updates(self):
|
951
952
|
"""
|
952
|
-
Sends a message to the plugin with the current progress of the sync run.
|
953
|
+
Sends a message to the plugin with the current progress of the sync run, if it has changed since last time.
|
953
954
|
"""
|
954
|
-
|
955
|
-
self._plugin_message(
|
956
|
-
message=PluginMessageStreamProgressUpdate(
|
955
|
+
new_progress_update = PluginMessageStreamProgressUpdate(
|
957
956
|
stream_total_counts=self._stream_record_counts,
|
958
957
|
completed_streams=self._completed_streams,
|
959
958
|
stream_errors=self._omnata_log_handler.stream_global_errors
|
960
959
|
)
|
961
|
-
|
960
|
+
if self._last_stream_progress_update is None or new_progress_update != self._last_stream_progress_update:
|
961
|
+
self._plugin_message(
|
962
|
+
message=new_progress_update
|
963
|
+
)
|
964
|
+
self._last_stream_progress_update = new_progress_update
|
962
965
|
|
963
966
|
def apply_cancellation(self):
|
964
967
|
"""
|
@@ -1223,8 +1226,6 @@ class InboundSyncRequest(SyncRequest):
|
|
1223
1226
|
raise ValueError(
|
1224
1227
|
f"Primary key field '{primary_key_field}' was not present in all records for stream {stream_name}"
|
1225
1228
|
)
|
1226
|
-
# TODO: handle the scenario where the primary key field is a list, and concatenate the values to form the APP_IDENTIFIER
|
1227
|
-
# Currently this is only implemented in the java runtime, since it's typically databases that use composite keys
|
1228
1229
|
results_df["APP_IDENTIFIER"] = results_df["RECORD_DATA"].apply(lambda x: get_nested_value(dict(x),primary_key_field))
|
1229
1230
|
# ensure APP_IDENTIFIER is a string
|
1230
1231
|
results_df["APP_IDENTIFIER"] = results_df["APP_IDENTIFIER"].apply(str)
|
@@ -59,10 +59,11 @@ class PluginEntrypoint:
|
|
59
59
|
self._plugin_instance._session = session # pylint: disable=protected-access
|
60
60
|
# the sync engine can override the snowflake connector log level via a session variable
|
61
61
|
default_snowflake_connector_log_level:str = "WARN"
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
if session is not None:
|
63
|
+
v = session.sql("select getvariable('SNOWFLAKE_CONNECTOR_LOG_LEVEL')").collect()
|
64
|
+
result = v[0][0]
|
65
|
+
if result is not None:
|
66
|
+
default_snowflake_connector_log_level = result
|
66
67
|
snowflake_logger = logging.getLogger("snowflake.connector")
|
67
68
|
snowflake_logger.setLevel(default_snowflake_connector_log_level)
|
68
69
|
snowflake_logger.propagate = False
|
{omnata_plugin_runtime-0.3.24a73.dist-info → omnata_plugin_runtime-0.3.24a75.dist-info}/RECORD
RENAMED
@@ -3,10 +3,10 @@ omnata_plugin_runtime/api.py,sha256=_N5ok5LN7GDO4J9n3yduXp3tpjmhpySY__U2baiygrs,
|
|
3
3
|
omnata_plugin_runtime/configuration.py,sha256=7cMekoY8CeZAJHpASU6tCMidF55Hzfr7CD74jtebqIY,35742
|
4
4
|
omnata_plugin_runtime/forms.py,sha256=pw_aKVsXSz47EP8PFBI3VDwdSN5IjvZxp8JTjO1V130,18421
|
5
5
|
omnata_plugin_runtime/logging.py,sha256=bn7eKoNWvtuyTk7RTwBS9UARMtqkiICtgMtzq3KA2V0,3272
|
6
|
-
omnata_plugin_runtime/omnata_plugin.py,sha256=
|
7
|
-
omnata_plugin_runtime/plugin_entrypoints.py,sha256
|
6
|
+
omnata_plugin_runtime/omnata_plugin.py,sha256=SYHOE3w134j7TA9ljmdUi1LtKrc7ZyIiozj5ycCHN94,103800
|
7
|
+
omnata_plugin_runtime/plugin_entrypoints.py,sha256=6ms3GeO8cx15MOl6731XDgLRSFHVKr6lfgiNguH7LyI,28327
|
8
8
|
omnata_plugin_runtime/rate_limiting.py,sha256=se6MftQI5NrVHaLb1hByPCgAESPQhkAgIG7KIU1clDU,16562
|
9
|
-
omnata_plugin_runtime-0.3.
|
10
|
-
omnata_plugin_runtime-0.3.
|
11
|
-
omnata_plugin_runtime-0.3.
|
12
|
-
omnata_plugin_runtime-0.3.
|
9
|
+
omnata_plugin_runtime-0.3.24a75.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
10
|
+
omnata_plugin_runtime-0.3.24a75.dist-info/METADATA,sha256=IDU8h_XFXR--ZHLo6vSuIu1eP7F_CqCM8RgpOMoWjjA,1604
|
11
|
+
omnata_plugin_runtime-0.3.24a75.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
+
omnata_plugin_runtime-0.3.24a75.dist-info/RECORD,,
|
{omnata_plugin_runtime-0.3.24a73.dist-info → omnata_plugin_runtime-0.3.24a75.dist-info}/LICENSE
RENAMED
File without changes
|
{omnata_plugin_runtime-0.3.24a73.dist-info → omnata_plugin_runtime-0.3.24a75.dist-info}/WHEEL
RENAMED
File without changes
|