vtlengine 1.0.3rc3__py3-none-any.whl → 1.1__py3-none-any.whl

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.

Potentially problematic release.


This version of vtlengine might be problematic. Click here for more details.

Files changed (53) hide show
  1. vtlengine/API/_InternalApi.py +288 -61
  2. vtlengine/API/__init__.py +269 -71
  3. vtlengine/API/data/schema/json_schema_2.1.json +116 -0
  4. vtlengine/AST/ASTComment.py +56 -0
  5. vtlengine/AST/ASTConstructor.py +76 -22
  6. vtlengine/AST/ASTConstructorModules/Expr.py +238 -120
  7. vtlengine/AST/ASTConstructorModules/ExprComponents.py +126 -61
  8. vtlengine/AST/ASTConstructorModules/Terminals.py +97 -42
  9. vtlengine/AST/ASTConstructorModules/__init__.py +50 -0
  10. vtlengine/AST/ASTEncoders.py +5 -1
  11. vtlengine/AST/ASTString.py +608 -0
  12. vtlengine/AST/ASTTemplate.py +28 -2
  13. vtlengine/AST/DAG/__init__.py +10 -4
  14. vtlengine/AST/Grammar/lexer.py +0 -1
  15. vtlengine/AST/Grammar/parser.py +185 -440
  16. vtlengine/AST/VtlVisitor.py +0 -1
  17. vtlengine/AST/__init__.py +127 -14
  18. vtlengine/DataTypes/TimeHandling.py +50 -15
  19. vtlengine/DataTypes/__init__.py +79 -7
  20. vtlengine/Exceptions/__init__.py +3 -5
  21. vtlengine/Exceptions/messages.py +74 -105
  22. vtlengine/Interpreter/__init__.py +136 -46
  23. vtlengine/Model/__init__.py +14 -11
  24. vtlengine/Operators/Aggregation.py +17 -9
  25. vtlengine/Operators/Analytic.py +64 -20
  26. vtlengine/Operators/Assignment.py +0 -1
  27. vtlengine/Operators/CastOperator.py +44 -44
  28. vtlengine/Operators/Clause.py +16 -10
  29. vtlengine/Operators/Comparison.py +20 -12
  30. vtlengine/Operators/Conditional.py +47 -15
  31. vtlengine/Operators/General.py +9 -4
  32. vtlengine/Operators/HROperators.py +4 -14
  33. vtlengine/Operators/Join.py +15 -14
  34. vtlengine/Operators/Numeric.py +32 -26
  35. vtlengine/Operators/RoleSetter.py +6 -2
  36. vtlengine/Operators/Set.py +12 -8
  37. vtlengine/Operators/String.py +9 -9
  38. vtlengine/Operators/Time.py +145 -124
  39. vtlengine/Operators/Validation.py +10 -4
  40. vtlengine/Operators/__init__.py +56 -69
  41. vtlengine/Utils/__init__.py +55 -1
  42. vtlengine/__extras_check.py +17 -0
  43. vtlengine/__init__.py +2 -2
  44. vtlengine/files/output/__init__.py +2 -1
  45. vtlengine/files/output/_time_period_representation.py +2 -1
  46. vtlengine/files/parser/__init__.py +52 -46
  47. vtlengine/files/parser/_time_checking.py +4 -4
  48. {vtlengine-1.0.3rc3.dist-info → vtlengine-1.1.dist-info}/METADATA +21 -17
  49. vtlengine-1.1.dist-info/RECORD +61 -0
  50. {vtlengine-1.0.3rc3.dist-info → vtlengine-1.1.dist-info}/WHEEL +1 -1
  51. vtlengine/DataTypes/NumericTypesHandling.py +0 -38
  52. vtlengine-1.0.3rc3.dist-info/RECORD +0 -58
  53. {vtlengine-1.0.3rc3.dist-info → vtlengine-1.1.dist-info}/LICENSE.md +0 -0
@@ -85,10 +85,13 @@ class DAGAnalyzer(ASTTemplate):
85
85
  all_output = []
86
86
  global_inputs = []
87
87
  inserted = []
88
+ persistent_datasets = []
88
89
  for key, statement in self.dependencies.items():
89
90
  outputs = statement[OUTPUTS]
90
91
  persistent = statement[PERSISTENT]
91
92
  reference = outputs + persistent
93
+ if len(persistent) == 1 and persistent[0] not in persistent_datasets:
94
+ persistent_datasets.append(persistent[0])
92
95
  deletion_key = key
93
96
  all_output.append(reference[0])
94
97
  for subKey, subStatement in self.dependencies.items():
@@ -127,10 +130,11 @@ class DAGAnalyzer(ASTTemplate):
127
130
  statements[INSERT][key] = [element]
128
131
 
129
132
  statements[GLOBAL] = global_inputs
133
+ statements[PERSISTENT] = persistent_datasets
130
134
  return statements
131
135
 
132
136
  @classmethod
133
- def createDAG(cls, ast: AST):
137
+ def createDAG(cls, ast: Start):
134
138
  """ """
135
139
  # Visit AST.
136
140
  dag = cls()
@@ -143,6 +147,11 @@ class DAGAnalyzer(ASTTemplate):
143
147
  # Create output dict.
144
148
  if len(dag.edges) != 0:
145
149
  dag.sortAST(ast)
150
+ else:
151
+ MLStatements: list = [
152
+ ML for ML in ast.children if not isinstance(ML, (HRuleset, DPRuleset, Operator))
153
+ ]
154
+ dag.check_overwriting(MLStatements)
146
155
  return dag
147
156
 
148
157
  except nx.NetworkXUnfeasible as error:
@@ -300,7 +309,6 @@ class DAGAnalyzer(ASTTemplate):
300
309
  self.visit(node.right)
301
310
 
302
311
  def visit_RegularAggregation(self, node: RegularAggregation) -> None:
303
-
304
312
  self.visit(node.dataset)
305
313
  for child in node.children:
306
314
  self.isFromRegularAggregation = True
@@ -329,7 +337,6 @@ class DAGAnalyzer(ASTTemplate):
329
337
  self.inputs.append(node.value)
330
338
 
331
339
  def visit_ParamOp(self, node: ParamOp) -> None:
332
-
333
340
  if self.udos and node.op in self.udos:
334
341
  DO_AST: Operator = self.udos[node.op]
335
342
 
@@ -426,7 +433,6 @@ class HRDAGAnalyzer(DAGAnalyzer):
426
433
  # def visit_Identifier(self, node: Identifier) -> None:
427
434
  if node.kind == "CodeItemID": # and node.value not in self.alias:
428
435
  if self.isFirstAssignment:
429
-
430
436
  self.isFirstAssignment = False
431
437
  self.outputs.append(node.value)
432
438
  else:
@@ -1116,7 +1116,6 @@ def serializedATN():
1116
1116
 
1117
1117
 
1118
1118
  class Lexer(Lexer):
1119
-
1120
1119
  atn = ATNDeserializer().deserialize(serializedATN())
1121
1120
 
1122
1121
  decisionsToDFA = [DFA(ds, i) for i, ds in enumerate(atn.decisionToState)]