omnata-plugin-runtime 0.10.27a285__tar.gz → 0.10.28__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.27a285
3
+ Version: 0.10.28
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.27-a285"
3
+ version = "0.10.28"
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"
@@ -289,10 +289,29 @@ class SnowflakeViewColumn(BaseModel):
289
289
  continue
290
290
  if column.original_name in (other_column.referenced_columns or {}).get(current_stream_name,[]):
291
291
  if column not in columns_to_move:
292
+ logger.debug(
293
+ f"Column {column.original_name} references {other_column.original_name}, moving it to the front"
294
+ )
292
295
  columns_to_move.append(column)
296
+ # we need to do another pass just on columns_to_move, because they may reference each other
297
+ # if any do, they go to the front, otherwise they are appended
298
+ columns_to_move_final:List[Self] = []
299
+ for column in columns_to_move:
300
+ for other_column in columns_to_move:
301
+ if column==other_column:
302
+ continue
303
+ if column.original_name in (other_column.referenced_columns or {}).get(current_stream_name,[]):
304
+ if column not in columns_to_move_final:
305
+ logger.debug(
306
+ f"Second pass: Column {column.original_name} is referenced by {other_column.original_name}, moving it to the front"
307
+ )
308
+ columns_to_move_final.insert(0, column)
309
+ continue
310
+ if column not in columns_to_move_final:
311
+ columns_to_move_final.append(column)
293
312
 
294
313
  # Move collected columns to the front
295
- for column in columns_to_move:
314
+ for column in columns_to_move_final:
296
315
  columns.remove(column)
297
316
  columns.insert(0, column)
298
317
  return omnata_system_columns_start + columns