omnata-plugin-runtime 0.4.0a86__tar.gz → 0.4.0a88__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.4.0a86
3
+ Version: 0.4.0a88
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "omnata-plugin-runtime"
3
- version = "0.4.0-a86"
3
+ version = "0.4.0-a88"
4
4
  description = "Classes and common runtime components for building and running Omnata Plugins"
5
5
  authors = ["James Weakley <james.weakley@omnata.com>"]
6
6
  readme = "README.md"
@@ -350,12 +350,13 @@ class SyncRequest(ABC):
350
350
  update_rate_limit_result = self._plugin_message(
351
351
  PluginMessageRateLimitState(rate_limit_state=self.rate_limit_state_this_sync_and_branch)
352
352
  )
353
- sync_id:int = update_rate_limit_result["sync_id"]
354
- sync_branch_name:str = update_rate_limit_result["sync_branch_name"]
355
- latest_state:Dict[int,Dict[str,Dict[str,RateLimitState]]] = parse_obj_as(Dict[int,Dict[str,Dict[str,RateLimitState]]],update_rate_limit_result["latest_state"])
356
- (rate_limit_state_all, rate_limit_state_this_branch) = RateLimitState.collapse(latest_state,sync_id, sync_branch_name)
357
- self.rate_limit_state_all = rate_limit_state_all
358
- self.rate_limit_state_this_sync_and_branch = rate_limit_state_this_branch
353
+ if update_rate_limit_result is not None:
354
+ sync_id:int = update_rate_limit_result["sync_id"]
355
+ sync_branch_name:str = update_rate_limit_result["sync_branch_name"]
356
+ latest_state:Dict[int,Dict[str,Dict[str,RateLimitState]]] = parse_obj_as(Dict[int,Dict[str,Dict[str,RateLimitState]]],update_rate_limit_result["latest_state"])
357
+ (rate_limit_state_all, rate_limit_state_this_branch) = RateLimitState.collapse(latest_state,sync_id, sync_branch_name)
358
+ self.rate_limit_state_all = rate_limit_state_all
359
+ self.rate_limit_state_this_sync_and_branch = rate_limit_state_this_branch
359
360
  else:
360
361
  logger.info("No rate limit state to update")
361
362
 
@@ -934,7 +935,6 @@ class InboundSyncRequest(SyncRequest):
934
935
  ] = self._stream_record_counts[stream_name] + total_length
935
936
  results.extend(non_empty_dfs) # remove any None/empty dataframes
936
937
  stream_names.append(stream_name)
937
- self._session.sql("begin").collect()
938
938
  if len(results) > 0:
939
939
  logger.info(
940
940
  f"Applying {len(results)} batches of queued results"
@@ -945,7 +945,6 @@ class InboundSyncRequest(SyncRequest):
945
945
  self._apply_results_dataframe(stream_names, all_dfs)
946
946
  # update the stream state object too
947
947
  self._apply_latest_states()
948
- self._session.sql("commit").collect()
949
948
  for stream_name in stream_names:
950
949
  self._apply_results[stream_name] = None
951
950
  self._apply_results = {}