omnata-plugin-runtime 0.10.7a251__tar.gz → 0.10.7a254__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.7a251
3
+ Version: 0.10.7a254
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.7-a251"
3
+ version = "0.10.7-a254"
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"
@@ -242,7 +242,7 @@ class SnowflakeViewColumn(BaseModel):
242
242
  )
243
243
 
244
244
  @classmethod
245
- def order_by_reference(cls,join_columns:List[Self]) -> List[Self]:
245
+ def order_by_reference(cls,columns:List[Self]) -> List[Self]:
246
246
  """
247
247
  In some situations, column expressions may reference the alias of another column
248
248
  This is allowed in Snowflake, as long as the aliased column is defined before it's used in a later column
@@ -253,17 +253,13 @@ class SnowflakeViewColumn(BaseModel):
253
253
  columns_to_move:List[Self] = []
254
254
  # Collect Omnata System columns and keep them at the front
255
255
  omnata_system_columns_start = []
256
- omnata_system_columns_end = []
257
- for column in join_columns[:]:
258
- if column.original_name=="OMNATA_APP_IDENTIFIER":
259
- join_columns.remove(column)
256
+ for column in columns[:]:
257
+ if column.original_name.startswith("OMNATA_"):
258
+ columns.remove(column)
260
259
  omnata_system_columns_start.append(column)
261
- elif column.original_name.startswith("OMNATA_"):
262
- join_columns.remove(column)
263
- omnata_system_columns_end.append(column)
264
260
 
265
- for column in join_columns:
266
- for other_column in join_columns:
261
+ for column in columns:
262
+ for other_column in columns:
267
263
  if column==other_column:
268
264
  continue
269
265
  if f'"{column.original_name}"' in other_column.expression:
@@ -272,9 +268,9 @@ class SnowflakeViewColumn(BaseModel):
272
268
 
273
269
  # Move collected columns to the front
274
270
  for column in columns_to_move:
275
- join_columns.remove(column)
276
- join_columns.insert(0, column)
277
- return omnata_system_columns_start + join_columns + omnata_system_columns_end
271
+ columns.remove(column)
272
+ columns.insert(0, column)
273
+ return omnata_system_columns_start + columns
278
274
 
279
275
 
280
276
  class SnowflakeViewJoin(BaseModel):
@@ -406,7 +402,7 @@ class SnowflakeViewPart(BaseModel):
406
402
  # the outer view definition has all of the column names and comments, but with the direct columns
407
403
  # first and the join columns last, same as they are ordered in the inner query
408
404
  return [
409
- c.name_with_comment(binding_list) for c in (self.direct_columns() + self.join_columns())
405
+ c.name_with_comment(binding_list) for c in self.columns
410
406
  ]
411
407
 
412
408
  def cte_text(self,original_name: bool = False) -> str: