omnata-plugin-runtime 0.10.8a256__tar.gz → 0.10.9a258__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.10.8a256
3
+ Version: 0.10.9a258
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.10.8-a256"
3
+ version = "0.10.9-a258"
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"
@@ -173,10 +173,22 @@ class SnowflakeViewColumn(BaseModel):
173
173
  )
174
174
 
175
175
  def __repr__(self) -> str:
176
- return "SnowflakeViewColumn(name=%r, definition=%r, comment=%r)" % (
176
+ return """SnowflakeViewColumn(
177
+ name=%r,
178
+ original_name=%r,
179
+ expression=%r,
180
+ comment=%r,
181
+ is_join_column=%r,
182
+ required_stream_names=%r,
183
+ referenced_columns=%r)
184
+ """ % (
177
185
  self.name,
178
- self.definition(),
186
+ self.original_name,
187
+ self.expression,
179
188
  self.comment,
189
+ self.is_join_column,
190
+ self.required_stream_names,
191
+ self.referenced_columns
180
192
  )
181
193
 
182
194
  def definition(self,original_name:bool = False) -> str:
@@ -555,7 +567,8 @@ def prune(view_part:SnowflakeViewPart,joined_parts:List[SnowflakeViewPart]) -> b
555
567
  return True
556
568
  else:
557
569
  # no columns were removed, but we need to check if the columns that are referenced are not themselves referencing other missing columns
558
- return prune(part,joined_parts)
570
+ if part != view_part:
571
+ return prune(part,joined_parts)
559
572
 
560
573
  return False
561
574
 
@@ -613,7 +626,7 @@ class JsonSchemaTopLevel(BaseModel):
613
626
  - current_comment_path is the same length as above, and contains any "description" values found on the way down
614
627
  """
615
628
  json_property = JsonSchemaProperty.model_validate(property_value)
616
- # bit of basic home-grown validation, could probably use a library for this
629
+ children = []
617
630
  if json_property.type:
618
631
  if json_property.type == "object":
619
632
  # TODO: make this depth configurable on the sync
@@ -629,8 +642,7 @@ class JsonSchemaTopLevel(BaseModel):
629
642
  )
630
643
  for child_property_name, child_property_value in json_property.properties.items()
631
644
  ]
632
- return [item for sublist in children for item in sublist]
633
-
645
+ children = [item for sublist in children for item in sublist]
634
646
  current_field_name_path = current_field_name_path + [property_name]
635
647
  current_comment_path = current_comment_path + [
636
648
  json_property.description or ""
@@ -638,7 +650,7 @@ class JsonSchemaTopLevel(BaseModel):
638
650
  # remove empty strings from current_comment_path
639
651
  current_comment_path = [c for c in current_comment_path if c]
640
652
 
641
- return [SnowflakeViewColumn.from_json_schema_property(
653
+ columns = [SnowflakeViewColumn.from_json_schema_property(
642
654
  column_name="_".join(current_field_name_path),
643
655
  comment=" -> ".join(current_comment_path),
644
656
  variant_path=":".join([f'"{p}"' for p in current_field_name_path if p]),
@@ -646,6 +658,8 @@ class JsonSchemaTopLevel(BaseModel):
646
658
  column_name_environment=column_name_environment,
647
659
  column_name_expression=column_name_expression
648
660
  )]
661
+ columns.extend(children)
662
+ return columns
649
663
 
650
664
 
651
665
  def normalized_view_part(