omnata-plugin-runtime 0.10.0a224__py3-none-any.whl → 0.10.1__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.
@@ -583,6 +583,30 @@ class NgrokTunnelSettings(SubscriptableBaseModel):
583
583
  description="The ngrok client key, in PEM format",
584
584
  )
585
585
 
586
+ class OutboundRecordTransformationParameters(SubscriptableBaseModel):
587
+ """
588
+ Allows the plugin author to determine how records are transformed before being sent to the target app.
589
+ Since conversion to objects causes a loss of some data types (e.g. timestamps and dates become strings),
590
+ and different Snowflake accounts may have different timestamp output formats, specifying the format allows
591
+ for a consistent result in the transformed records.
592
+ """
593
+ timestamp_tz_format: str = Field(
594
+ default="YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM",
595
+ title="The format to use when converting TIMESTAMP_TZ values to strings in the transformed record."
596
+ )
597
+ timestamp_ntz_format: str = Field(
598
+ default="YYYY-MM-DD HH24:MI:SS.FF3",
599
+ title="The format to use when converting TIMESTAMP_NTZ values to strings in the transformed record."
600
+ )
601
+ timestamp_ltz_format: str = Field(
602
+ default="YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM",
603
+ title="The format to use when converting TIMESTAMP_LTZ values to strings in the transformed record."
604
+ )
605
+ date_format: str = Field(
606
+ default="YYYY-MM-DD",
607
+ title="YYYY-MM-DD"
608
+ )
609
+
586
610
  class ConnectionConfigurationParameters(SubscriptableBaseModel):
587
611
  """
588
612
  Contains user-provided information completed during connection configuration.
@@ -77,6 +77,7 @@ from .configuration import (
77
77
  get_secrets,
78
78
  ConnectivityOption,
79
79
  OutboundTargetType,
80
+ OutboundRecordTransformationParameters
80
81
  )
81
82
  from .forms import (
82
83
  ConnectionMethod,
@@ -105,6 +106,12 @@ class PluginManifest(SubscriptableBaseModel):
105
106
  :param bool supports_inbound: A flag to indicate whether or not the plugin supports inbound sync. Support for inbound sync behaviours (full/incremental) is defined per inbound stream.
106
107
  :param List[OutboundSyncStrategy] supported_outbound_strategies: A list of sync strategies that the plugin can support, e.g. create,upsert.
107
108
  :param List[ConnectivityOption] supported_connectivity_options: A list of connectivity options that the plugin can support, e.g. direct,ngrok,privatelink
109
+ :param str timestamp_tz_format: The format to use when converting TIMESTAMP_TZ values to strings in the transformed record.
110
+ :param str timestamp_ntz_format: The format to use when converting TIMESTAMP_NTZ values to strings in the transformed record.
111
+ :param str timestamp_ltz_format: The format to use when converting TIMESTAMP_LTZ values to strings in the transformed record.
112
+ For each of the above three formats, you can include "{{precision}}" to substitute the precision of the timestamp, if that matters.
113
+ For example, "YYYY-MM-DDTHH24:MI:SS.FF{{precision}}TZHTZM" would be a valid format string.
114
+ :param str date_format: The format to use when converting DATE values to strings in the transformed record.
108
115
  """
109
116
 
110
117
  plugin_id: str
@@ -123,6 +130,10 @@ class PluginManifest(SubscriptableBaseModel):
123
130
  default=None,
124
131
  title="An optional list of target types that the plugin can support."
125
132
  )
133
+ outbound_target_transformation_parameters: OutboundRecordTransformationParameters = Field(
134
+ default_factory=lambda: OutboundRecordTransformationParameters(),
135
+ title="The parameters for transforming records for various Snowflake data types"
136
+ )
126
137
 
127
138
  class SnowflakeFunctionParameter(BaseModel):
128
139
  """
@@ -1315,9 +1326,10 @@ class InboundSyncRequest(SyncRequest):
1315
1326
  for datetime_property in datetime_properties:
1316
1327
  try:
1317
1328
  if datetime_property in data and data[datetime_property] is not None:
1329
+ contains_forward_slash = "/" in data[datetime_property]
1318
1330
  data[datetime_property] = parse(
1319
1331
  data[datetime_property],
1320
- dayfirst=True # no self respecting API should be using US date formats
1332
+ dayfirst=contains_forward_slash # no self respecting API should be using US date formats
1321
1333
  ).isoformat()
1322
1334
  except Exception as exception2:
1323
1335
  logger.debug(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.10.0a224
3
+ Version: 0.10.1
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,13 +1,13 @@
1
1
  omnata_plugin_runtime/__init__.py,sha256=MS9d1whnfT_B3-ThqZ7l63QeC_8OEKTuaYV5wTwRpBA,1576
2
2
  omnata_plugin_runtime/api.py,sha256=baGraSMiD4Yvi3ZWrEv_TKh8Ktd1U8riBdOpe9j0Puw,8202
3
- omnata_plugin_runtime/configuration.py,sha256=H1snDDtS4DF2AILynob878ZKcronnZl5Qig6dE9KDoc,41189
3
+ omnata_plugin_runtime/configuration.py,sha256=_l7Cohf8qfZwXP6vCCryAwjPnhltLJWuaiJB3woYmyw,42361
4
4
  omnata_plugin_runtime/forms.py,sha256=9YHJ_T17lT-rwyDaUg_0yj_YMPda4DRCw_wrvf8hE0E,19964
5
5
  omnata_plugin_runtime/json_schema.py,sha256=7nsluzRHn5gmlV4V2G1ostOBstUuIbacBbQr3WsqGcU,26795
6
6
  omnata_plugin_runtime/logging.py,sha256=WBuZt8lF9E5oFWM4KYQbE8dDJ_HctJ1pN3BHwU6rcd0,4461
7
- omnata_plugin_runtime/omnata_plugin.py,sha256=-OGXrPgxxdawDX4gdc0-uqKyut6lHDxUQrgFGcuAqA0,131722
7
+ omnata_plugin_runtime/omnata_plugin.py,sha256=8Sh0XP_NofgNxI_ogsWrjLSOcLmduDvrz3ZUvLCkqi4,132882
8
8
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=iqGl8_nEEnPGKg3Aem4YLSQ6d5xS3ju5gq8MJbx6sCA,31968
9
9
  omnata_plugin_runtime/rate_limiting.py,sha256=qpr5esU4Ks8hMzuMpSR3gLFdor2ZUXYWCjmsQH_K6lQ,25882
10
- omnata_plugin_runtime-0.10.0a224.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
- omnata_plugin_runtime-0.10.0a224.dist-info/METADATA,sha256=9LCcMjA7wFRE22W-5DtRnwvbto6QdvRZCS0HCwFfKUI,2211
12
- omnata_plugin_runtime-0.10.0a224.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
13
- omnata_plugin_runtime-0.10.0a224.dist-info/RECORD,,
10
+ omnata_plugin_runtime-0.10.1.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
11
+ omnata_plugin_runtime-0.10.1.dist-info/METADATA,sha256=FbSuEbVxN9Xcc28Ieo7puYUPM9D3BU1ZKcC3vkWf8f0,2207
12
+ omnata_plugin_runtime-0.10.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
13
+ omnata_plugin_runtime-0.10.1.dist-info/RECORD,,