vtlengine 1.0__py3-none-any.whl → 1.0.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 (54) hide show
  1. vtlengine/API/_InternalApi.py +153 -100
  2. vtlengine/API/__init__.py +109 -67
  3. vtlengine/AST/ASTConstructor.py +188 -98
  4. vtlengine/AST/ASTConstructorModules/Expr.py +306 -200
  5. vtlengine/AST/ASTConstructorModules/ExprComponents.py +172 -102
  6. vtlengine/AST/ASTConstructorModules/Terminals.py +158 -95
  7. vtlengine/AST/ASTEncoders.py +1 -1
  8. vtlengine/AST/ASTTemplate.py +8 -9
  9. vtlengine/AST/ASTVisitor.py +8 -12
  10. vtlengine/AST/DAG/__init__.py +43 -35
  11. vtlengine/AST/DAG/_words.py +4 -4
  12. vtlengine/AST/Grammar/lexer.py +732 -142
  13. vtlengine/AST/Grammar/parser.py +2188 -826
  14. vtlengine/AST/Grammar/tokens.py +128 -128
  15. vtlengine/AST/VtlVisitor.py +7 -4
  16. vtlengine/AST/__init__.py +22 -11
  17. vtlengine/DataTypes/NumericTypesHandling.py +5 -4
  18. vtlengine/DataTypes/TimeHandling.py +194 -301
  19. vtlengine/DataTypes/__init__.py +304 -218
  20. vtlengine/Exceptions/__init__.py +52 -27
  21. vtlengine/Exceptions/messages.py +134 -62
  22. vtlengine/Interpreter/__init__.py +781 -487
  23. vtlengine/Model/__init__.py +165 -121
  24. vtlengine/Operators/Aggregation.py +156 -95
  25. vtlengine/Operators/Analytic.py +115 -59
  26. vtlengine/Operators/Assignment.py +7 -4
  27. vtlengine/Operators/Boolean.py +27 -32
  28. vtlengine/Operators/CastOperator.py +177 -131
  29. vtlengine/Operators/Clause.py +137 -99
  30. vtlengine/Operators/Comparison.py +148 -117
  31. vtlengine/Operators/Conditional.py +149 -98
  32. vtlengine/Operators/General.py +68 -47
  33. vtlengine/Operators/HROperators.py +91 -72
  34. vtlengine/Operators/Join.py +217 -118
  35. vtlengine/Operators/Numeric.py +89 -44
  36. vtlengine/Operators/RoleSetter.py +16 -15
  37. vtlengine/Operators/Set.py +61 -36
  38. vtlengine/Operators/String.py +213 -139
  39. vtlengine/Operators/Time.py +334 -216
  40. vtlengine/Operators/Validation.py +117 -76
  41. vtlengine/Operators/__init__.py +340 -213
  42. vtlengine/Utils/__init__.py +195 -40
  43. vtlengine/__init__.py +1 -1
  44. vtlengine/files/output/__init__.py +15 -6
  45. vtlengine/files/output/_time_period_representation.py +10 -9
  46. vtlengine/files/parser/__init__.py +77 -52
  47. vtlengine/files/parser/_rfc_dialect.py +6 -5
  48. vtlengine/files/parser/_time_checking.py +46 -37
  49. vtlengine-1.0.1.dist-info/METADATA +236 -0
  50. vtlengine-1.0.1.dist-info/RECORD +58 -0
  51. {vtlengine-1.0.dist-info → vtlengine-1.0.1.dist-info}/WHEEL +1 -1
  52. vtlengine-1.0.dist-info/METADATA +0 -104
  53. vtlengine-1.0.dist-info/RECORD +0 -58
  54. {vtlengine-1.0.dist-info → vtlengine-1.0.1.dist-info}/LICENSE.md +0 -0
@@ -1,9 +1,22 @@
1
1
  from antlr4.tree.Tree import TerminalNodeImpl
2
2
 
3
- from vtlengine.AST import Aggregation, If, BinOp, UnaryOp, ID, ParamOp, MulOp, Constant, \
4
- ParamConstant, \
5
- TimeAggregation, \
6
- Identifier, EvalOp, VarID, Analytic, UDOCall
3
+ from vtlengine.AST import (
4
+ Aggregation,
5
+ If,
6
+ BinOp,
7
+ UnaryOp,
8
+ ID,
9
+ ParamOp,
10
+ MulOp,
11
+ Constant,
12
+ ParamConstant,
13
+ TimeAggregation,
14
+ Identifier,
15
+ EvalOp,
16
+ VarID,
17
+ Analytic,
18
+ UDOCall,
19
+ )
7
20
  from vtlengine.AST.ASTConstructorModules.Terminals import Terminals
8
21
  from vtlengine.AST.Grammar.parser import Parser
9
22
  from vtlengine.AST.VtlVisitor import VtlVisitor
@@ -14,26 +27,26 @@ class ExprComp(VtlVisitor):
14
27
  """______________________________________________________________________________________
15
28
 
16
29
 
17
- ExprComponent Definition.
30
+ ExprComponent Definition.
18
31
 
19
- _______________________________________________________________________________________"""
32
+ _______________________________________________________________________________________"""
20
33
 
21
34
  def visitExprComponent(self, ctx: Parser.ExprComponentContext):
22
35
  """
23
- exprComponent:
24
- LPAREN exprComponent RPAREN # parenthesisExprComp
25
- | functionsComponents # functionsExpressionComp
26
- | op=(PLUS|MINUS|NOT) right=exprComponent # unaryExprComp
27
- | left=exprComponent op=(MUL|DIV) right=exprComponent # arithmeticExprComp
28
- | left=exprComponent op=(PLUS|MINUS|CONCAT) right=exprComponent # arithmeticExprOrConcatComp
29
- | left=exprComponent comparisonOperand right=exprComponent # comparisonExprComp
30
- | left=exprComponent op=(IN|NOT_IN)(lists|valueDomainID) # inNotInExprComp
31
- | left=exprComponent op=AND right=exprComponent # booleanExprComp
32
- | left=exprComponent op=(OR|XOR) right=exprComponent # booleanExprComp
33
- | IF conditionalExpr=exprComponent THEN thenExpr=exprComponent ELSE elseExpr=exprComponent # ifExprComp
34
- | constant # constantExprComp
35
- | componentID # compId
36
- ;
36
+ exprComponent:
37
+ LPAREN exprComponent RPAREN # parenthesisExprComp # noqa E501
38
+ | functionsComponents # functionsExpressionComp # noqa E501
39
+ | op=(PLUS|MINUS|NOT) right=exprComponent # unaryExprComp # noqa E501
40
+ | left=exprComponent op=(MUL|DIV) right=exprComponent # arithmeticExprComp # noqa E501
41
+ | left=exprComponent op=(PLUS|MINUS|CONCAT) right=exprComponent # arithmeticExprOrConcatComp # noqa E501
42
+ | left=exprComponent comparisonOperand right=exprComponent # comparisonExprComp # noqa E501
43
+ | left=exprComponent op=(IN|NOT_IN)(lists|valueDomainID) # inNotInExprComp # noqa E501
44
+ | left=exprComponent op=AND right=exprComponent # booleanExprComp # noqa E501
45
+ | left=exprComponent op=(OR|XOR) right=exprComponent # booleanExprComp # noqa E501
46
+ | IF conditionalExpr=exprComponent THEN thenExpr=exprComponent ELSE elseExpr=exprComponent # ifExprComp # noqa E501
47
+ | constant # constantExprComp # noqa E501
48
+ | componentID # compId # noqa E501
49
+ ;
37
50
  """
38
51
  ctx_list = list(ctx.getChildren())
39
52
  c = ctx_list[0]
@@ -85,9 +98,9 @@ class ExprComp(VtlVisitor):
85
98
  return Terminals().visitComponentID(c)
86
99
  token = c.children[0].getSymbol()
87
100
  # check token text
88
- has_scaped_char = token.text.find("\'") != -1
101
+ has_scaped_char = token.text.find("'") != -1
89
102
  if has_scaped_char:
90
- token.text = str(token.text.replace("\'", ""))
103
+ token.text = str(token.text.replace("'", ""))
91
104
  var_id_node = VarID(token.text)
92
105
  return var_id_node
93
106
 
@@ -170,14 +183,14 @@ class ExprComp(VtlVisitor):
170
183
  elif isinstance(c, TerminalNodeImpl):
171
184
  token = c.getSymbol()
172
185
  opt = token.text
173
- return ID('OPTIONAL', opt)
186
+ return ID("OPTIONAL", opt)
174
187
 
175
- """______________________________________________________________________________________
188
+ """____________________________________________________________________________________
176
189
 
177
190
 
178
- FunctionsComponents Definition.
191
+ FunctionsComponents Definition.
179
192
 
180
- _______________________________________________________________________________________"""
193
+ _____________________________________________________________________________________"""
181
194
 
182
195
  def visitFunctionsComponents(self, ctx: Parser.FunctionsComponentsContext):
183
196
  """
@@ -224,7 +237,7 @@ class ExprComp(VtlVisitor):
224
237
 
225
238
  """
226
239
  -----------------------------------
227
- Generic Functions Components
240
+ Generic Functions Components
228
241
  -----------------------------------
229
242
  """
230
243
 
@@ -240,56 +253,74 @@ class ExprComp(VtlVisitor):
240
253
 
241
254
  def visitCallComponent(self, ctx: Parser.CallComponentContext):
242
255
  """
243
- callFunction: operatorID LPAREN (parameterComponent (COMMA parameterComponent)*)? RPAREN # callComponent
256
+ callFunction: operatorID LPAREN (parameterComponent (COMMA parameterComponent)*)? RPAREN # callComponent # noqa E501
244
257
  """
245
258
  ctx_list = list(ctx.getChildren())
246
259
  c = ctx_list[0]
247
260
 
248
261
  op = Terminals().visitOperatorID(c)
249
- param_nodes = [self.visitParameterComponent(element) for element in ctx_list if
250
- isinstance(element, Parser.ParameterComponentContext)]
262
+ param_nodes = [
263
+ self.visitParameterComponent(element)
264
+ for element in ctx_list
265
+ if isinstance(element, Parser.ParameterComponentContext)
266
+ ]
251
267
 
252
268
  return UDOCall(op=op, params=param_nodes)
253
269
 
254
270
  def visitEvalAtomComponent(self, ctx: Parser.EvalAtomComponentContext):
255
271
  """
256
- | EVAL LPAREN routineName LPAREN (componentID|scalarItem)? (COMMA (componentID|scalarItem))* RPAREN (LANGUAGE STRING_CONSTANT)? (RETURNS outputParameterTypeComponent)? RPAREN # evalAtomComponent
272
+ | EVAL LPAREN routineName LPAREN (componentID|scalarItem)? (COMMA (componentID|scalarItem))* RPAREN (LANGUAGE STRING_CONSTANT)? (RETURNS outputParameterTypeComponent)? RPAREN # evalAtomComponent # noqa E501
257
273
  """
258
274
  ctx_list = list(ctx.getChildren())
259
275
 
260
276
  routine_name = Terminals().visitRoutineName(ctx_list[2])
261
277
 
262
278
  # Think of a way to maintain the order, for now its not necessary.
263
- var_ids_nodes = [Terminals().visitVarID(varID) for varID in ctx_list if
264
- isinstance(varID, Parser.VarIDContext)]
265
- constant_nodes = [Terminals().visitScalarItem(scalar) for scalar in ctx_list if
266
- isinstance(scalar, Parser.ScalarItemContext)]
279
+ var_ids_nodes = [
280
+ Terminals().visitVarID(varID)
281
+ for varID in ctx_list
282
+ if isinstance(varID, Parser.VarIDContext)
283
+ ]
284
+ constant_nodes = [
285
+ Terminals().visitScalarItem(scalar)
286
+ for scalar in ctx_list
287
+ if isinstance(scalar, Parser.ScalarItemContext)
288
+ ]
267
289
  children_nodes = var_ids_nodes + constant_nodes
268
290
 
269
291
  if len(children_nodes) > 1:
270
292
  raise Exception("Only one operand is allowed in Eval")
271
293
 
272
294
  # Reference manual says it is mandatory.
273
- language_name = [language for language in ctx_list if
274
- isinstance(language,
275
- TerminalNodeImpl) and language.getSymbol().type == Parser.STRING_CONSTANT]
295
+ language_name = [
296
+ language
297
+ for language in ctx_list
298
+ if isinstance(language, TerminalNodeImpl)
299
+ and language.getSymbol().type == Parser.STRING_CONSTANT
300
+ ]
276
301
  if len(language_name) == 0:
277
302
  # AST_ASTCONSTRUCTOR.12
278
- raise SemanticError("1-4-2-1", option='language')
303
+ raise SemanticError("1-4-2-1", option="language")
279
304
  # Reference manual says it is mandatory.
280
- output_node = [Terminals().visitOutputParameterTypeComponent(output) for output in ctx_list
281
- if
282
- isinstance(output, Parser.OutputParameterTypeComponentContext)]
305
+ output_node = [
306
+ Terminals().visitOutputParameterTypeComponent(output)
307
+ for output in ctx_list
308
+ if isinstance(output, Parser.OutputParameterTypeComponentContext)
309
+ ]
283
310
  if len(output_node) == 0:
284
311
  # AST_ASTCONSTRUCTOR.13
285
- raise SemanticError("1-4-2-1", option='output')
312
+ raise SemanticError("1-4-2-1", option="output")
286
313
 
287
- return EvalOp(name=routine_name, operands=children_nodes[0], output=output_node[0],
288
- language=language_name[0].getSymbol().text)
314
+ return EvalOp(
315
+ name=routine_name,
316
+ operands=children_nodes[0],
317
+ output=output_node[0],
318
+ language=language_name[0].getSymbol().text,
319
+ )
289
320
 
290
321
  def visitCastExprComponent(self, ctx: Parser.CastExprComponentContext):
291
322
  """
292
- | CAST LPAREN exprComponent COMMA (basicScalarType|valueDomainName) (COMMA STRING_CONSTANT)? RPAREN # castExprComponent
323
+ | CAST LPAREN exprComponent COMMA (basicScalarType|valueDomainName) (COMMA STRING_CONSTANT)? RPAREN # castExprComponent # noqa E501
293
324
  """
294
325
  ctx_list = list(ctx.getChildren())
295
326
  c = ctx_list[0]
@@ -297,19 +328,30 @@ class ExprComp(VtlVisitor):
297
328
  token = c.getSymbol()
298
329
 
299
330
  op = token.text
300
- expr_node = [self.visitExprComponent(expr) for expr in ctx_list if
301
- isinstance(expr, Parser.ExprComponentContext)]
302
- basic_scalar_type = [Terminals().visitBasicScalarType(type_) for type_ in ctx_list if
303
- isinstance(type_, Parser.BasicScalarTypeContext)]
304
-
305
- [Terminals().visitValueDomainName(valueD) for valueD in ctx_list if
306
- isinstance(valueD, Parser.ValueDomainNameContext)]
331
+ expr_node = [
332
+ self.visitExprComponent(expr)
333
+ for expr in ctx_list
334
+ if isinstance(expr, Parser.ExprComponentContext)
335
+ ]
336
+ basic_scalar_type = [
337
+ Terminals().visitBasicScalarType(type_)
338
+ for type_ in ctx_list
339
+ if isinstance(type_, Parser.BasicScalarTypeContext)
340
+ ]
341
+
342
+ [
343
+ Terminals().visitValueDomainName(valueD)
344
+ for valueD in ctx_list
345
+ if isinstance(valueD, Parser.ValueDomainNameContext)
346
+ ]
307
347
 
308
348
  if len(ctx_list) > 6:
309
- param_node = [ParamConstant('PARAM_CAST', str_.symbol.text.strip('"')) for str_ in
310
- ctx_list if
311
- isinstance(str_,
312
- TerminalNodeImpl) and str_.getSymbol().type == Parser.STRING_CONSTANT]
349
+ param_node = [
350
+ ParamConstant("PARAM_CAST", str_.symbol.text.strip('"'))
351
+ for str_ in ctx_list
352
+ if isinstance(str_, TerminalNodeImpl)
353
+ and str_.getSymbol().type == Parser.STRING_CONSTANT
354
+ ]
313
355
  else:
314
356
  param_node = []
315
357
 
@@ -330,13 +372,13 @@ class ExprComp(VtlVisitor):
330
372
  if isinstance(c, Parser.ExprComponentContext):
331
373
  return self.visitExprComponent(c)
332
374
  elif isinstance(c, TerminalNodeImpl):
333
- return ID('OPTIONAL', c.getSymbol().text)
375
+ return ID("OPTIONAL", c.getSymbol().text)
334
376
  else:
335
377
  raise NotImplementedError
336
378
 
337
379
  """
338
380
  -----------------------------------
339
- String Functions
381
+ String Functions
340
382
  -----------------------------------
341
383
  """
342
384
 
@@ -370,8 +412,9 @@ class ExprComp(VtlVisitor):
370
412
 
371
413
  token = c.getSymbol()
372
414
  childrens = [expr for expr in ctx_list if isinstance(expr, Parser.ExprComponentContext)]
373
- params = [param for param in ctx_list if
374
- isinstance(param, Parser.OptionalExprComponentContext)]
415
+ params = [
416
+ param for param in ctx_list if isinstance(param, Parser.OptionalExprComponentContext)
417
+ ]
375
418
 
376
419
  op_node = token.text
377
420
  for children in childrens:
@@ -388,10 +431,16 @@ class ExprComp(VtlVisitor):
388
431
  c = ctx_list[0]
389
432
 
390
433
  token = c.getSymbol()
391
- expressions = [self.visitExprComponent(expr) for expr in ctx_list if
392
- isinstance(expr, Parser.ExprComponentContext)]
393
- params = [self.visitOptionalExprComponent(param) for param in ctx_list if
394
- isinstance(param, Parser.OptionalExprComponentContext)]
434
+ expressions = [
435
+ self.visitExprComponent(expr)
436
+ for expr in ctx_list
437
+ if isinstance(expr, Parser.ExprComponentContext)
438
+ ]
439
+ params = [
440
+ self.visitOptionalExprComponent(param)
441
+ for param in ctx_list
442
+ if isinstance(param, Parser.OptionalExprComponentContext)
443
+ ]
395
444
 
396
445
  op_node = token.text
397
446
 
@@ -405,10 +454,16 @@ class ExprComp(VtlVisitor):
405
454
  c = ctx_list[0]
406
455
 
407
456
  token = c.getSymbol()
408
- expressions = [self.visitExprComponent(expr) for expr in ctx_list if
409
- isinstance(expr, Parser.ExprComponentContext)]
410
- params = [self.visitOptionalExprComponent(param) for param in ctx_list if
411
- isinstance(param, Parser.OptionalExprComponentContext)]
457
+ expressions = [
458
+ self.visitExprComponent(expr)
459
+ for expr in ctx_list
460
+ if isinstance(expr, Parser.ExprComponentContext)
461
+ ]
462
+ params = [
463
+ self.visitOptionalExprComponent(param)
464
+ for param in ctx_list
465
+ if isinstance(param, Parser.OptionalExprComponentContext)
466
+ ]
412
467
 
413
468
  op_node = token.text
414
469
 
@@ -419,7 +474,7 @@ class ExprComp(VtlVisitor):
419
474
 
420
475
  """
421
476
  -----------------------------------
422
- Numeric Component Functions
477
+ Numeric Component Functions
423
478
  -----------------------------------
424
479
  """
425
480
 
@@ -442,8 +497,9 @@ class ExprComp(VtlVisitor):
442
497
  operand_node = self.visitExprComponent(ctx_list[2])
443
498
  return UnaryOp(op_node, operand_node)
444
499
 
445
- def visitUnaryWithOptionalNumericComponent(self,
446
- ctx: Parser.UnaryWithOptionalNumericComponentContext):
500
+ def visitUnaryWithOptionalNumericComponent(
501
+ self, ctx: Parser.UnaryWithOptionalNumericComponentContext
502
+ ):
447
503
  ctx_list = list(ctx.getChildren())
448
504
  c = ctx_list[0]
449
505
 
@@ -452,8 +508,9 @@ class ExprComp(VtlVisitor):
452
508
 
453
509
  token = c.getSymbol()
454
510
  childrens = [expr for expr in ctx_list if isinstance(expr, Parser.ExprComponentContext)]
455
- params = [param for param in ctx_list if
456
- isinstance(param, Parser.OptionalExprComponentContext)]
511
+ params = [
512
+ param for param in ctx_list if isinstance(param, Parser.OptionalExprComponentContext)
513
+ ]
457
514
 
458
515
  op_node = token.text
459
516
  for children in childrens:
@@ -478,7 +535,7 @@ class ExprComp(VtlVisitor):
478
535
 
479
536
  """
480
537
  -----------------------------------
481
- Time Functions
538
+ Time Functions
482
539
  -----------------------------------
483
540
  """
484
541
 
@@ -506,8 +563,11 @@ class ExprComp(VtlVisitor):
506
563
  c = ctx_list[0]
507
564
 
508
565
  op = c.getSymbol().text
509
- operand_node = [self.visitExprComponent(operand) for operand in ctx_list if
510
- isinstance(operand, Parser.ExprComponentContext)]
566
+ operand_node = [
567
+ self.visitExprComponent(operand)
568
+ for operand in ctx_list
569
+ if isinstance(operand, Parser.ExprComponentContext)
570
+ ]
511
571
 
512
572
  if len(operand_node) == 0:
513
573
  # AST_ASTCONSTRUCTOR.15
@@ -524,7 +584,7 @@ class ExprComp(VtlVisitor):
524
584
 
525
585
  op = c.getSymbol().text
526
586
  left_node = self.visitExprComponent(ctx_list[2])
527
- right_node = Constant('INTEGER_CONSTANT', int(ctx_list[4].getSymbol().text))
587
+ right_node = Constant("INTEGER_CONSTANT", int(ctx_list[4].getSymbol().text))
528
588
 
529
589
  return BinOp(left=left_node, op=op, right=right_node)
530
590
 
@@ -539,7 +599,7 @@ class ExprComp(VtlVisitor):
539
599
  children_node = [self.visitExprComponent(ctx_list[2])]
540
600
 
541
601
  if len(ctx_list) > 4:
542
- param_constant_node = [ParamConstant('PARAM_TIMESERIES', ctx_list[4].getSymbol().text)]
602
+ param_constant_node = [ParamConstant("PARAM_TIMESERIES", ctx_list[4].getSymbol().text)]
543
603
  else:
544
604
  param_constant_node = []
545
605
 
@@ -547,8 +607,8 @@ class ExprComp(VtlVisitor):
547
607
 
548
608
  def visitTimeAggAtomComponent(self, ctx: Parser.TimeAggAtomComponentContext):
549
609
  """
550
- TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))?
551
- (COMMA op=optionalExprComponent)? (COMMA (FIRST|LAST))? RPAREN # timeAggAtomComponent;
610
+ TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? # noqa E501
611
+ (COMMA op=optionalExprComponent)? (COMMA (FIRST|LAST))? RPAREN # timeAggAtomComponent; # noqa E501
552
612
  """
553
613
  ctx_list = list(ctx.getChildren())
554
614
  c = ctx_list[0]
@@ -561,9 +621,12 @@ class ExprComp(VtlVisitor):
561
621
  # raise SemanticError("periodIndFrom is not allowed in Time_agg")
562
622
  period_from = str(ctx.periodIndFrom.text)[1:-1]
563
623
 
564
- conf = [str_.getSymbol().text for str_ in ctx_list if
565
- isinstance(str_, TerminalNodeImpl) and str_.getSymbol().type in [Parser.FIRST,
566
- Parser.LAST]]
624
+ conf = [
625
+ str_.getSymbol().text
626
+ for str_ in ctx_list
627
+ if isinstance(str_, TerminalNodeImpl)
628
+ and str_.getSymbol().type in [Parser.FIRST, Parser.LAST]
629
+ ]
567
630
 
568
631
  if len(conf) == 0:
569
632
  conf = None
@@ -582,8 +645,9 @@ class ExprComp(VtlVisitor):
582
645
  if operand_node is None:
583
646
  # AST_ASTCONSTRUCTOR.17
584
647
  raise SemanticError("1-4-2-2")
585
- return TimeAggregation(op=op, operand=operand_node, period_to=period_to,
586
- period_from=period_from, conf=conf)
648
+ return TimeAggregation(
649
+ op=op, operand=operand_node, period_to=period_to, period_from=period_from, conf=conf
650
+ )
587
651
 
588
652
  def visitCurrentDateAtomComponent(self, ctx: Parser.CurrentDateAtomComponentContext):
589
653
  c = list(ctx.getChildren())[0]
@@ -591,12 +655,13 @@ class ExprComp(VtlVisitor):
591
655
 
592
656
  """
593
657
  -----------------------------------
594
- Conditional Functions
658
+ Conditional Functions
595
659
  -----------------------------------
596
660
  """
597
661
 
598
- def visitConditionalFunctionsComponents(self,
599
- ctx: Parser.ConditionalFunctionsComponentsContext):
662
+ def visitConditionalFunctionsComponents(
663
+ self, ctx: Parser.ConditionalFunctionsComponentsContext
664
+ ):
600
665
  if isinstance(ctx, Parser.NvlAtomComponentContext):
601
666
  return self.visitNvlAtomComponent(ctx)
602
667
  else:
@@ -615,7 +680,7 @@ class ExprComp(VtlVisitor):
615
680
 
616
681
  """
617
682
  -----------------------------------
618
- Comparison Components Functions
683
+ Comparison Components Functions
619
684
  -----------------------------------
620
685
  """
621
686
 
@@ -664,7 +729,7 @@ class ExprComp(VtlVisitor):
664
729
 
665
730
  """
666
731
  -----------------------------------
667
- Aggregate Components Functions
732
+ Aggregate Components Functions
668
733
  -----------------------------------
669
734
  """
670
735
 
@@ -689,7 +754,7 @@ class ExprComp(VtlVisitor):
689
754
 
690
755
  """
691
756
  -----------------------------------
692
- Analytic Components Functions
757
+ Analytic Components Functions
693
758
  -----------------------------------
694
759
  """
695
760
 
@@ -729,8 +794,9 @@ class ExprComp(VtlVisitor):
729
794
  else:
730
795
  raise NotImplementedError
731
796
 
732
- return Analytic(op=op_node, operand=operand, partition_by=partition_by, order_by=order_by,
733
- window=params)
797
+ return Analytic(
798
+ op=op_node, operand=operand, partition_by=partition_by, order_by=order_by, window=params
799
+ )
734
800
 
735
801
  def visitLagOrLeadAnComponent(self, ctx: Parser.LagOrLeadAnComponentContext):
736
802
  ctx_list = list(ctx.getChildren())
@@ -749,8 +815,9 @@ class ExprComp(VtlVisitor):
749
815
  elif isinstance(c, Parser.OrderByClauseContext):
750
816
  order_by = Terminals().visitOrderByClause(c)
751
817
  continue
752
- elif isinstance(c, Parser.SignedIntegerContext) or isinstance(c,
753
- Parser.ScalarItemContext):
818
+ elif isinstance(c, Parser.SignedIntegerContext) or isinstance(
819
+ c, Parser.ScalarItemContext
820
+ ):
754
821
  if params is None:
755
822
  params = []
756
823
  if isinstance(c, Parser.SignedIntegerContext):
@@ -759,8 +826,9 @@ class ExprComp(VtlVisitor):
759
826
  params.append(Terminals().visitScalarItem(c))
760
827
  continue
761
828
 
762
- return Analytic(op=op_node, operand=operand, partition_by=partition_by, order_by=order_by,
763
- params=params)
829
+ return Analytic(
830
+ op=op_node, operand=operand, partition_by=partition_by, order_by=order_by, params=params
831
+ )
764
832
 
765
833
  def visitRankAnComponent(self, ctx: Parser.RankAnComponentContext):
766
834
  ctx_list = list(ctx.getChildren())
@@ -778,8 +846,9 @@ class ExprComp(VtlVisitor):
778
846
  order_by = Terminals().visitOrderByClause(c)
779
847
  continue
780
848
 
781
- return Analytic(op=op_node, operand=None, partition_by=partition_by, order_by=order_by,
782
- window=None)
849
+ return Analytic(
850
+ op=op_node, operand=None, partition_by=partition_by, order_by=order_by, window=None
851
+ )
783
852
 
784
853
  def visitRatioToReportAnComponent(self, ctx: Parser.RatioToReportAnComponentContext):
785
854
  ctx_list = list(ctx.getChildren())
@@ -792,5 +861,6 @@ class ExprComp(VtlVisitor):
792
861
 
793
862
  partition_by = Terminals().visitPartitionByClause(ctx_list[5])
794
863
 
795
- return Analytic(op=op_node, operand=operand, partition_by=partition_by, order_by=order_by,
796
- window=params)
864
+ return Analytic(
865
+ op=op_node, operand=operand, partition_by=partition_by, order_by=order_by, window=params
866
+ )