omnata-plugin-runtime 0.10.14a268__tar.gz → 0.10.15a269__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.14a268
3
+ Version: 0.10.15a269
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.14-a268"
3
+ version = "0.10.15-a269"
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"
@@ -493,7 +493,7 @@ class SnowflakeViewParts(BaseModel):
493
493
  self.main_part.cte_text(original_name=True)
494
494
  ] + [
495
495
  part.cte_text(original_name=True,include_only_columns=all_referenced_columns.get(part.stream_name))
496
- for part in self.joined_parts
496
+ for part in joined_parts_deduped
497
497
  ]
498
498
  # we need a final CTE which selects the main part's direct columns and joined columns, with their original names
499
499
  # then the final select statement will just be aliasing to the transformed names
@@ -535,6 +535,7 @@ class SnowflakeViewParts(BaseModel):
535
535
  Returns the building blocks required to create a normalized view from a stream.
536
536
  This includes any joins that are required, via CTEs.
537
537
  """
538
+ logger.debug(f"Generating view parts for stream: {stream_name}")
538
539
  # we start with the view parts for the view we are building
539
540
  main_stream_view_part = normalized_view_part(
540
541
  stream_name=stream_name,
@@ -551,6 +552,7 @@ class SnowflakeViewParts(BaseModel):
551
552
  and join.join_stream_name in stream_schemas]
552
553
 
553
554
  for join in main_stream_view_part.joins:
555
+ logger.debug(f"Generating view parts for join stream: {join.join_stream_name}")
554
556
  joined_parts.append(normalized_view_part(
555
557
  stream_name=join.join_stream_name,
556
558
  raw_table_location=raw_stream_locations[join.join_stream_name],
@@ -577,6 +579,7 @@ class SnowflakeViewParts(BaseModel):
577
579
 
578
580
  # Process all joins to build the mappings
579
581
  for part in [main_stream_view_part] + joined_parts:
582
+ logger.debug(f"Processing joins for stream: {part.stream_name}")
580
583
  # Make sure the part's stream name is in the mappings
581
584
  if part.stream_name not in stream_to_aliases:
582
585
  stream_to_aliases[part.stream_name] = {part.stream_name}
@@ -656,6 +659,11 @@ class SnowflakeViewParts(BaseModel):
656
659
  # These are not considered circular references
657
660
  if all(ref_type == "join" or ref_type == "join_reverse" for ref_type, _ in refs1):
658
661
  continue
662
+
663
+ # Skip self-references (same stream referencing itself)
664
+ # These are not considered circular references
665
+ if source_stream == target_stream:
666
+ continue
659
667
 
660
668
  # Check for direct circular references
661
669
  reverse_key = (target, source)
@@ -666,27 +674,17 @@ class SnowflakeViewParts(BaseModel):
666
674
  if all(ref_type == "join" or ref_type == "join_reverse" for ref_type, _ in refs2):
667
675
  continue
668
676
 
677
+ # Skip if the references are through different aliases
678
+ # This is not a circular reference
679
+ if source != target and target != source:
680
+ continue
681
+
669
682
  raise ValueError(f"""Cyclic dependency detected: Circular reference between {source} and {target}.
670
683
  {source} -> {target}: {refs1}
671
684
  {target} -> {source}: {refs2}""")
672
685
 
673
- # Check for circular references through aliases
674
- for (other_source, other_target), refs2 in circular_refs.items():
675
- if source == other_source or target == other_target:
676
- continue # Skip self-comparisons
677
-
678
- # Skip references that are just join relationships
679
- if all(ref_type == "join" or ref_type == "join_reverse" for ref_type, _ in refs2):
680
- continue
681
-
682
- other_source_stream = alias_to_stream.get(other_source, other_source)
683
- other_target_stream = alias_to_stream.get(other_target, other_target)
684
-
685
- # Check if this is a circular reference through aliases
686
- if target_stream == other_source_stream and source_stream == other_target_stream:
687
- raise ValueError(f"""Cyclic dependency detected: Circular reference through aliases.
688
- {source} ({source_stream}) -> {target} ({target_stream}): {refs1}
689
- {other_source} ({other_source_stream}) -> {other_target} ({other_target_stream}): {refs2}""")
686
+ # We don't need to check for circular references through aliases
687
+ # because we're already handling them in the direct circular reference check above
690
688
 
691
689
  # If we get here, no circular references were found
692
690
  logger.debug("No circular references found")
@@ -702,7 +700,7 @@ class SnowflakeViewParts(BaseModel):
702
700
  prune_count = 0
703
701
  while prune(main_stream_view_part, joined_parts):
704
702
  prune_count += 1
705
- if prune_count > 10000:
703
+ if prune_count > 10:
706
704
  raise ValueError("Pruning of columns from the view has entered an infinite loop")
707
705
 
708
706
  return cls(main_part=main_stream_view_part, joined_parts=joined_parts)