omnata-plugin-runtime 0.10.15a269__tar.gz → 0.10.16__tar.gz
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.
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/PKG-INFO +1 -1
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/pyproject.toml +1 -1
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/json_schema.py +21 -12
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/LICENSE +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/README.md +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/__init__.py +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/api.py +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/configuration.py +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/forms.py +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/logging.py +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/omnata_plugin.py +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/plugin_entrypoints.py +0 -0
- {omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/rate_limiting.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "omnata-plugin-runtime"
|
3
|
-
version = "0.10.
|
3
|
+
version = "0.10.16"
|
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"
|
@@ -218,18 +218,19 @@ class SnowflakeViewColumn(BaseModel):
|
|
218
218
|
|
219
219
|
@classmethod
|
220
220
|
def from_json_schema_property(cls,
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
221
|
+
column_name:str,
|
222
|
+
comment:str,
|
223
|
+
variant_path:str,
|
224
|
+
json_schema_property:JsonSchemaProperty,
|
225
|
+
column_name_environment:Environment,
|
226
|
+
column_name_expression:str,
|
227
|
+
plugin_app_database: Optional[str] = None,) -> Self:
|
227
228
|
"""
|
228
229
|
Takes a JSON schema property (which may be nested via variant_path), along with its final name and comment,
|
229
230
|
and returns a SnowflakeViewColumn object which is ready to use in a select statement.
|
230
231
|
It does this by applying overarching type conversion rules, and evaluating the final column name using Jinja.
|
231
232
|
"""
|
232
|
-
jinja_vars = {"column_name": column_name}
|
233
|
+
jinja_vars = {"column_name": column_name,"plugin_app_database": plugin_app_database}
|
233
234
|
final_column_name = column_name_environment.from_string(column_name_expression).render(**jinja_vars)
|
234
235
|
expression = f"""RECORD_DATA:{variant_path}"""
|
235
236
|
if json_schema_property.snowflakeColumnExpression:
|
@@ -529,7 +530,8 @@ class SnowflakeViewParts(BaseModel):
|
|
529
530
|
stream_name: str,
|
530
531
|
include_default_columns: bool = True,
|
531
532
|
column_name_environment: Environment = Environment(),
|
532
|
-
column_name_expression: str = "{{column_name}}"
|
533
|
+
column_name_expression: str = "{{column_name}}",
|
534
|
+
plugin_app_database: Optional[str] = None,
|
533
535
|
) -> Self:
|
534
536
|
"""
|
535
537
|
Returns the building blocks required to create a normalized view from a stream.
|
@@ -796,7 +798,8 @@ class JsonSchemaTopLevel(BaseModel):
|
|
796
798
|
|
797
799
|
def build_view_columns(self,
|
798
800
|
column_name_environment: Environment,
|
799
|
-
column_name_expression: str
|
801
|
+
column_name_expression: str,
|
802
|
+
plugin_app_database: Optional[str] = None,
|
800
803
|
) -> List[SnowflakeViewColumn]:
|
801
804
|
"""
|
802
805
|
Returns a list of column definitions from a json schema
|
@@ -809,6 +812,7 @@ class JsonSchemaTopLevel(BaseModel):
|
|
809
812
|
property_value=property_value,
|
810
813
|
column_name_environment=column_name_environment,
|
811
814
|
column_name_expression=column_name_expression,
|
815
|
+
plugin_app_database=plugin_app_database,
|
812
816
|
)
|
813
817
|
for property_name, property_value in self.properties.items()
|
814
818
|
]
|
@@ -822,7 +826,8 @@ class JsonSchemaTopLevel(BaseModel):
|
|
822
826
|
column_name_environment: Environment,
|
823
827
|
column_name_expression: str,
|
824
828
|
current_field_name_path: List[str] = [],
|
825
|
-
current_comment_path: List[str] = []
|
829
|
+
current_comment_path: List[str] = [],
|
830
|
+
plugin_app_database: Optional[str] = None,
|
826
831
|
) -> List[SnowflakeViewColumn]:
|
827
832
|
"""
|
828
833
|
Recursive function which returns a list of column definitions.
|
@@ -845,6 +850,7 @@ class JsonSchemaTopLevel(BaseModel):
|
|
845
850
|
column_name_expression=column_name_expression,
|
846
851
|
current_field_name_path=current_field_name_path + [property_name],
|
847
852
|
current_comment_path=current_comment_path + [json_property.description or ""],
|
853
|
+
plugin_app_database=plugin_app_database,
|
848
854
|
)
|
849
855
|
for child_property_name, child_property_value in json_property.properties.items()
|
850
856
|
]
|
@@ -862,7 +868,8 @@ class JsonSchemaTopLevel(BaseModel):
|
|
862
868
|
variant_path=":".join([f'"{p}"' for p in current_field_name_path if p]),
|
863
869
|
json_schema_property=json_property,
|
864
870
|
column_name_environment=column_name_environment,
|
865
|
-
column_name_expression=column_name_expression
|
871
|
+
column_name_expression=column_name_expression,
|
872
|
+
plugin_app_database=plugin_app_database,
|
866
873
|
)]
|
867
874
|
columns.extend(children)
|
868
875
|
return columns
|
@@ -875,6 +882,7 @@ def normalized_view_part(
|
|
875
882
|
column_name_environment: Environment,
|
876
883
|
column_name_expression: str,
|
877
884
|
stream_schema: Optional[Dict] = None,
|
885
|
+
plugin_app_database: Optional[str] = None,
|
878
886
|
) -> SnowflakeViewPart:
|
879
887
|
"""
|
880
888
|
Returns an object containing:
|
@@ -937,7 +945,8 @@ def normalized_view_part(
|
|
937
945
|
json_schema = JsonSchemaTopLevel.model_validate(stream_schema)
|
938
946
|
view_columns += json_schema.build_view_columns(
|
939
947
|
column_name_environment=column_name_environment,
|
940
|
-
column_name_expression=column_name_expression
|
948
|
+
column_name_expression=column_name_expression,
|
949
|
+
plugin_app_database=plugin_app_database,
|
941
950
|
)
|
942
951
|
if json_schema.joins:
|
943
952
|
joins = json_schema.joins
|
File without changes
|
File without changes
|
File without changes
|
{omnata_plugin_runtime-0.10.15a269 → omnata_plugin_runtime-0.10.16}/src/omnata_plugin_runtime/api.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|