vtlengine 1.0.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
@@ -6,6 +6,8 @@ Description
6
6
  -----------
7
7
  All exceptions exposed by the Vtl engine.
8
8
  """
9
+
10
+ from typing import Optional, Any, List
9
11
  from vtlengine.Exceptions.messages import centralised_messages
10
12
 
11
13
  dataset_output = None
@@ -14,7 +16,13 @@ dataset_output = None
14
16
  class VTLEngineException(Exception):
15
17
  """Base class for exceptions in this module."""
16
18
 
17
- def __init__(self, message, lino=None, colno=None, code=None):
19
+ def __init__(
20
+ self,
21
+ message: str,
22
+ lino: Optional[str] = None,
23
+ colno: Optional[str] = None,
24
+ code: Optional[str] = None,
25
+ ) -> None:
18
26
  if code is not None:
19
27
  super().__init__(message, code)
20
28
  else:
@@ -23,10 +31,9 @@ class VTLEngineException(Exception):
23
31
  self.colno = colno
24
32
 
25
33
  @property
26
- def pos(self):
27
- """
34
+ def pos(self) -> List[Optional[str]]:
35
+ """ """
28
36
 
29
- """
30
37
  return [self.lino, self.colno]
31
38
 
32
39
 
@@ -40,30 +47,40 @@ class DataTypeException(VTLEngineException):
40
47
  ))
41
48
  """
42
49
 
43
- def __init__(self, message='default_value', lino=None, colno=None):
50
+ def __init__(
51
+ self,
52
+ message: str = "default_value",
53
+ lino: Optional[str] = None,
54
+ colno: Optional[str] = None,
55
+ ) -> None:
44
56
  super().__init__(message, lino, colno)
45
57
 
46
58
 
47
59
  class SyntaxError(VTLEngineException):
48
- """
49
-
50
- """
51
-
52
- def __init__(self, message='default_value', lino=None, colno=None):
60
+ """ """
61
+
62
+ def __init__(
63
+ self,
64
+ message: str = "default_value",
65
+ lino: Optional[str] = None,
66
+ colno: Optional[str] = None,
67
+ ) -> None:
53
68
  super().__init__(message, lino, colno)
54
69
 
55
70
 
56
71
  class SemanticError(VTLEngineException):
57
- """
72
+ """ """
58
73
 
59
- """
60
74
  output_message = " Please check transformation with output dataset "
61
75
  comp_code = None
62
76
 
63
- def __init__(self, code, comp_code=None, **kwargs):
77
+ def __init__(self, code: str, comp_code: Optional[str] = None, **kwargs: Any) -> None:
64
78
  if dataset_output:
65
- message = centralised_messages[code].format(**kwargs) + self.output_message + str(
66
- dataset_output)
79
+ message = (
80
+ centralised_messages[code].format(**kwargs)
81
+ + self.output_message
82
+ + str(dataset_output)
83
+ )
67
84
  else:
68
85
  message = centralised_messages[code].format(**kwargs)
69
86
 
@@ -76,30 +93,38 @@ class SemanticError(VTLEngineException):
76
93
  class InterpreterError(VTLEngineException):
77
94
  output_message = " Please check transformation with output dataset "
78
95
 
79
- def __init__(self, code, **kwargs):
96
+ def __init__(self, code: str, **kwargs: Any) -> None:
80
97
  if dataset_output:
81
- message = centralised_messages[code].format(**kwargs) + self.output_message + str(
82
- dataset_output)
98
+ message = (
99
+ centralised_messages[code].format(**kwargs)
100
+ + self.output_message
101
+ + str(dataset_output)
102
+ )
83
103
  else:
84
104
  message = centralised_messages[code].format(**kwargs)
85
105
  super().__init__(message, None, None, code)
86
106
 
87
107
 
88
108
  class RuntimeError(VTLEngineException):
89
- """
90
-
91
- """
109
+ """ """
92
110
 
93
- def __init__(self, message, lino=None, colno=None):
111
+ def __init__(
112
+ self, message: str, lino: Optional[str] = None, colno: Optional[str] = None
113
+ ) -> None:
94
114
  super().__init__(message, lino, colno)
95
115
 
96
116
 
97
117
  class InputValidationException(VTLEngineException):
98
- """
99
-
100
- """
101
-
102
- def __init__(self, message='default_value', lino=None, colno=None, code=None, **kwargs):
118
+ """ """
119
+
120
+ def __init__(
121
+ self,
122
+ message: str = "default_value",
123
+ lino: Optional[str] = None,
124
+ colno: Optional[str] = None,
125
+ code: Optional[str] = None,
126
+ **kwargs: Any
127
+ ) -> None:
103
128
  if code is not None:
104
129
  message = centralised_messages[code].format(**kwargs)
105
130
  super().__init__(message, lino, colno, code)
@@ -6,9 +6,11 @@ Description
6
6
  -----------
7
7
  All exceptions exposed by the Vtl engine.
8
8
  """
9
+
9
10
  centralised_messages = {
10
11
  # Input Validation errors
11
- "0-1-2-1": "Invalid json structure because additional properties have been supplied on file {filename}.",
12
+ "0-1-2-1": "Invalid json structure because additional properties have been supplied "
13
+ "on file {filename}.",
12
14
  "0-1-2-2": "Errors found on file {filename}: {errors}",
13
15
  "0-1-2-3": "Component {component} is duplicated.",
14
16
  "0-1-2-4": "Invalid json structure because {err} on file {filename}.",
@@ -19,12 +21,15 @@ centralised_messages = {
19
21
  # "0-1-1-1": "A csv file or a dataframe is required.",
20
22
  "0-1-1-2": "The provided {source} must have data to can infer the data structure.",
21
23
  "0-1-1-3": "Can not infer data structure: {errors}",
22
- "0-1-1-4": "On Dataset {name} loading: An identifier cannot have null values, found null values on {null_identifier}.",
23
- "0-1-1-5": "On Dataset {name} loading: Datasets without identifiers must have 0 or 1 datapoints.",
24
+ "0-1-1-4": "On Dataset {name} loading: An identifier cannot have null values, found null "
25
+ "values on {null_identifier}.",
26
+ "0-1-1-5": "On Dataset {name} loading: Datasets without identifiers must have 0 or "
27
+ "1 datapoints.",
24
28
  "0-1-1-6": "Duplicated records. Combination of identifiers are repeated.",
25
29
  "0-1-1-7": "G1 - The provided CSV file is empty",
26
30
  "0-1-1-8": "The following identifiers {ids} were not found , review file {file}",
27
- "0-1-1-9": "You have a problem related with commas, review rfc4180 standard, review file {file}",
31
+ "0-1-1-9": "You have a problem related with commas, review rfc4180 standard, review file "
32
+ "{file}",
28
33
  "0-1-1-10": "On Dataset {name} loading: Component {comp_name} is missing in Datapoints.",
29
34
  "0-1-1-11": "Wrong data in the file for this scalardataset {name}",
30
35
  "0-1-1-12": "On Dataset {name} loading: not possible to cast column {column} to {type}",
@@ -37,56 +42,69 @@ centralised_messages = {
37
42
  "1-1-1-2": "Invalid implicit cast from {type_1} and {type_2} to {type_check}.",
38
43
  "1-1-1-3": "At op {op}: {entity} {name} cannot be promoted to {target_type}.",
39
44
  # "1-1-1-2": "At op {op}: Component {comp_name} type must be '{type_1}', found '{type_2}'.",
40
- # "1-1-1-3": "At op {op}: Invalid data type for Component {comp_name} and Scalar {scalar_name}.",
45
+ # "1-1-1-3": "At op {op}: Invalid data type for Component {comp_name} and Scalar
46
+ # {scalar_name}.",
41
47
  "1-1-1-4": "At op {op}: Operation not allowed for multimeasure datasets.",
42
48
  # "1-1-1-5": "At op {op}: Invalid data type {type} for Scalar {scalar_name}.",
43
- # "1-1-1-6": "At op {op}: Internal error: Not same parents.", # TODO: Deprecated not in use, delete this.
49
+ # TODO: Deprecated not in use, delete this.
50
+ # "1-1-1-6": "At op {op}: Internal error: Not same parents.",
44
51
  # "1-1-1-7": "At op {op}: Invalid data type {type} for Component {name}.",
45
52
  "1-1-1-8": "At op {op}: Invalid Dataset {name}, no measures defined.",
46
53
  "1-1-1-9": "At op {op}: Invalid Dataset {name}, all measures must have the same type: {type}.",
47
54
  "1-1-1-10": "Component {comp_name} not found in Dataset {dataset_name}.",
48
55
  # "1-1-1-11": "At op {op}: Identifier {name} is specified more than once.",
49
- # "1-1-1-12": "At op {op}: Different scalar types for component {comp_name} and set {set_name}.",
56
+ # "1-1-1-12": "At op {op}: Different scalar types for component {comp_name} and set
57
+ # {set_name}.",
50
58
  "1-1-1-13": "At op {op}: Component {comp_name} role must be '{role_1}', found '{role_2}'.",
51
59
  # "1-1-1-14": "At op {op}: Dataset {name} type must be '{type_1}'.",
52
- "1-1-1-15": "At op {op}: Datasets {name_1} and {name_2} does not contain the same number of {type}.",
60
+ "1-1-1-15": "At op {op}: Datasets {name_1} and {name_2} does not contain the same number of "
61
+ "{type}.",
53
62
  "1-1-1-16": "Found structure not nullable and null values.",
54
63
  # "1-1-1-17": "At op {op}: Problem with nullability for this components {name_1} and {name_2}.",
55
64
  # "1-1-1-18": "No {type} {value} found.",
56
- # "1-1-1-19": "At op {op}: Invalid data type for Scalar {scalar_name_1} and Scalar {scalar_name_2}.",
65
+ # "1-1-1-19": "At op {op}: Invalid data type for Scalar {scalar_name_1} and Scalar
66
+ # {scalar_name_2}.",
57
67
  "1-1-1-20": "At op {op}: Only applies to datasets, instead of this a Scalar was provided.",
58
68
  # General Interpreter errors
59
69
  # "2-1-1-1": "At op {op}: Unable to evaluate.",
60
- # "2-1-1-2": "At op {op}: Dataset {name} is empty.", # TODO: Review this message, for unpivot for example we can't raise this error, because we can have a empty dataset
70
+ # "2-1-1-2": "At op {op}: Dataset {name} is empty.",
71
+ # TODO: Review this message, for unpivot for example we can't raise this error,
72
+ # because we can have a empty dataset
61
73
  # "2-1-1-3": "At op {op}: No rules have results.",
62
74
  # Aggregate errors
63
75
  # TODO: Use error message 1-1-1-8
64
76
  # "1-1-2-1": "At op {op}: No measures found to aggregate.",
65
- "1-1-2-2": "At op {op}: Only Identifiers are allowed for grouping, found {id_name} - {id_type}.",
77
+ "1-1-2-2": "At op {op}: Only Identifiers are allowed for grouping, "
78
+ "found {id_name} - {id_type}.",
66
79
  "1-1-2-3": "Having component output type must be boolean, found {type}.",
67
-
68
80
  # "1-1-2-4": "At op {op}: Component {id_name} not found in dataset",
69
81
  # Analytic errors
70
82
  # TODO: Use error message 1-1-1-8
71
83
  # "1-1-3-1": "At op {op}: No measures found to analyse.",
72
- "1-1-3-2": "At op {op}: Only Identifiers are allowed for partitioning, found {id_name} - {id_type}.",
84
+ "1-1-3-2": "At op {op}: Only Identifiers are allowed for partitioning, "
85
+ "found {id_name} - {id_type}.",
73
86
  # Cast errors
74
87
  "1-1-5-1": "Type {type_1}, cannot be cast to {type_2}.",
75
88
  "1-1-5-3": "Impossible to cast from type {type_1} to {type_2}, without providing a mask.",
76
89
  "1-1-5-4": "Invalid mask to cast from type {type_1} to {type_2}.",
77
- "1-1-5-5": "A mask can't be provided to cast from type {type_1} to {type_2}. Mask provided: {mask_value}.",
90
+ "1-1-5-5": "A mask can't be provided to cast from type {type_1} to {type_2}. Mask provided: "
91
+ "{mask_value}.",
78
92
  "2-1-5-1": "Impossible to cast {value} from type {type_1} to {type_2}.",
79
93
  # Clause errors
80
94
  # "1-1-6-1": "At op {op}: Component {comp_name} not found in dataset {dataset_name}.",
81
- "1-1-6-2": "At op {op}: The identifier {name} in dataset {dataset} could not be included in the {op} op.",
82
- # TODO: This is not possible at all, as calc clause adds a new column and identifiers are still unique
95
+ "1-1-6-2": "At op {op}: The identifier {name} in dataset {dataset} could not be included "
96
+ "in the {op} op.",
97
+ # TODO: This is not possible at all, as calc clause adds a new column and
98
+ # identifiers are still unique
83
99
  # "1-1-6-3": "Found duplicated values on identifiers after Calc clause.",
84
- "1-1-6-4": "At op {op}: Alias symbol cannot have the name of a component symbol: {symbol_name} - {comp_name}.",
100
+ "1-1-6-4": "At op {op}: Alias symbol cannot have the name of a component symbol: "
101
+ "{symbol_name} - {comp_name}.",
85
102
  "1-1-6-5": "At op {op}: Scalar values are not allowed at sub operator, found {name}.",
86
103
  "1-1-6-6": "Membership is not allowed inside a clause, found {dataset_name}#{comp_name}.",
87
104
  "1-1-6-7": "Cannot use component {comp_name} as it was generated in another calc expression.",
88
105
  # all the components used in calccomp must belong to the operand dataset
89
- "1-1-6-8": "Cannot use component {comp_name} for rename, it is already in the dataset {dataset_name}.",
106
+ "1-1-6-8": "Cannot use component {comp_name} for rename, it is already in the dataset "
107
+ "{dataset_name}.",
90
108
  # it is the same error that 1-1-8-1 AND similar but not the same 1-3-1
91
109
  "1-1-6-9": "At op {op}: The following components are repeated: {from_components}.",
92
110
  "1-1-6-10": "At op {op}: Component {operand} in dataset {dataset_name} is not an identifier",
@@ -96,64 +114,92 @@ centralised_messages = {
96
114
  "1-1-6-13": "At op {op}: Not allowed to overwrite an identifier: {comp_name}",
97
115
  # "1-1-6-15": "At op {op}: Component {comp_name} already exists in dataset {dataset_name}",
98
116
  # Comparison errors
99
- "1-1-7-1": "At op {op}: Value in {left_name} of type {left_type} is not comparable to value {right_name} of type {right_type}.",
117
+ "1-1-7-1": "At op {op}: Value in {left_name} of type {left_type} is not comparable to value "
118
+ "{right_name} of type {right_type}.",
100
119
  # Conditional errors
101
- "1-1-9-1": "At op {op}: The evaluation condition must result in a Boolean expression, found '{type}'.",
102
- "1-1-9-3": "At op {op}: Then clause {then_name} and else clause {else_name}, both must be Scalars.",
120
+ "1-1-9-1": "At op {op}: The evaluation condition must result in a Boolean "
121
+ "expression, found '{type}'.",
122
+ "1-1-9-3": "At op {op}: Then clause {then_name} and else clause {else_name}, both must be "
123
+ "Scalars.",
103
124
  "1-1-9-4": "At op {op}: The condition dataset {name} must contain an unique measure.",
104
125
  "1-1-9-5": "At op {op}: The condition dataset Measure must be a Boolean, found '{type}'.",
105
- "1-1-9-6": "At op {op}: Then-else datasets have different number of identifiers compared with condition dataset.",
106
- "1-1-9-9": "At op {op}: {clause} component {clause_name} role must be {role_1}, found {role_2}.",
107
- "1-1-9-10": "At op {op}: {clause} dataset have different number of identifiers compared with condition dataset.",
126
+ "1-1-9-6": "At op {op}: Then-else datasets have different number of identifiers compared "
127
+ "with condition dataset.",
128
+ "1-1-9-9": "At op {op}: {clause} component {clause_name} role must be {role_1}, found "
129
+ "{role_2}.",
130
+ "1-1-9-10": "At op {op}: {clause} dataset have different number of identifiers compared with "
131
+ "condition dataset.",
108
132
  "1-1-9-11": "At op {op}: Condition component {name} must be Boolean, found {type}.",
109
- "1-1-9-12": "At op {op}: then clause {then_symbol} and else clause {else_symbol}, both must be Datasets or at least one of them a Scalar.",
110
- "1-1-9-13": "At op {op}: then {then} and else {else_clause} datasets must contain the same number of components.",
133
+ "1-1-9-12": "At op {op}: then clause {then_symbol} and else clause {else_symbol}, both must "
134
+ "be Datasets or at least one of them a Scalar.",
135
+ "1-1-9-13": "At op {op}: then {then} and else {else_clause} datasets must contain the same "
136
+ "number of components.",
111
137
  # Data Validation errors
112
138
  "1-1-10-1": "At op {op}: The {op_type} operand must have exactly one measure of type {me_type}",
113
139
  "1-1-10-2": "At op {op}: Number of variable has to be equal between the call and signature.",
114
- "1-1-10-3": "At op {op}: Name in the call {found} has to be equal to variable rule in signature {expected} .",
115
- "1-1-10-4": "At op {op}: When a hierarchical ruleset is defined for value domain, it is necessary to specify the component with the rule clause on call.",
140
+ "1-1-10-3": "At op {op}: Name in the call {found} has to be equal to variable rule in "
141
+ "signature {expected}.",
142
+ "1-1-10-4": "At op {op}: When a hierarchical ruleset is defined for value domain, it is "
143
+ "necessary to specify the component with the rule clause on call.",
116
144
  "1-1-10-5": "No rules to analyze on Hierarchy Roll-up as rules have no = operator.",
117
- "1-1-10-6": "At op {op}: Name in the call {found} has to be equal to variable condition in signature {expected} .",
145
+ "1-1-10-6": "At op {op}: Name in the call {found} has to be equal to variable condition in "
146
+ "signature {expected} .",
118
147
  "1-1-10-7": "Not found component {comp_name} on signature.",
119
148
  "1-1-10-8": "At op {op}: Measures involved have to be numerical, other types found {found}.",
120
- "1-1-10-9": "Invalid signature for the ruleset {ruleset}. On variables, condComp and ruleComp must be the same",
149
+ "1-1-10-9": "Invalid signature for the ruleset {ruleset}. On variables, condComp and "
150
+ "ruleComp must be the same",
121
151
  # General Operators
122
- # "1-1-12-1": "At op {op}: You could not recalculate the identifier {name} on dataset {dataset}.",
123
- # "2-1-12-1": "At op {op}: Create a null measure without a scalar type is not allowed. Please use cast operator.",
152
+ # "1-1-12-1": "At op {op}: You could not recalculate the identifier {name} on dataset "
153
+ # "{dataset}.",
154
+ # "2-1-12-1": "At op {op}: Create a null measure without a scalar type is not allowed. "
155
+ # "Please use cast operator.",
124
156
  # Join Operators
125
157
  "1-1-13-1": "At op {op}: Duplicated alias {duplicates}.",
126
158
  "1-1-13-2": "At op {op}: Missing mandatory aliasing.",
127
- "1-1-13-3": "At op {op}: Join conflict with duplicated names for column {name} from original datasets.",
128
- "1-1-13-4": "At op {op}: Using clause, using={using_names}, does not define all the identifiers, of non reference dataset {dataset}.",
129
- "1-1-13-5": "At op {op}: Invalid subcase B1, All the datasets must share as identifiers the using ones.",
159
+ "1-1-13-3": "At op {op}: Join conflict with duplicated names for column {name} from original "
160
+ "datasets.",
161
+ "1-1-13-4": "At op {op}: Using clause, using={using_names}, does not define all the "
162
+ "identifiers, of non reference dataset {dataset}.",
163
+ "1-1-13-5": "At op {op}: Invalid subcase B1, All the datasets must share as identifiers the "
164
+ "using ones.",
130
165
  # not in use but we keep for later, in use 1-1-13-4
131
- "1-1-13-6": "At op {op}: Invalid subcase B2, All the declared using components '{using_components}' must be present as components in the reference dataset '{reference}'.",
132
- "1-1-13-7": "At op {op}: Invalid subcase B2, All the non reference datasets must share as identifiers the using ones.",
166
+ "1-1-13-6": "At op {op}: Invalid subcase B2, All the declared using components "
167
+ "'{using_components}' must be present as components in the reference dataset "
168
+ "'{reference}'.",
169
+ "1-1-13-7": "At op {op}: Invalid subcase B2, All the non reference datasets must share as "
170
+ "identifiers the using ones.",
133
171
  "1-1-13-8": "At op {op}: No available using clause.",
134
172
  "1-1-13-9": "Ambiguity for this variable {comp_name} inside a join clause.",
135
173
  "1-1-13-10": "The join operator does not perform scalar/component operations.",
136
- "1-1-13-11": "At op {op}: Invalid subcase A, {dataset_reference} should be a superset but {component} not found.",
174
+ "1-1-13-11": "At op {op}: Invalid subcase A, {dataset_reference} should be a superset but "
175
+ "{component} not found.",
137
176
  # inner_join and left join
138
- "1-1-13-12": "At op {op}: Invalid subcase A. There are different identifiers for the provided datasets",
177
+ "1-1-13-12": "At op {op}: Invalid subcase A. There are different identifiers for the provided "
178
+ "datasets",
139
179
  # full_join
140
- "1-1-13-13": "At op {op}: Invalid subcase A. There are not same number of identifiers for the provided datasets",
180
+ "1-1-13-13": "At op {op}: Invalid subcase A. There are not same number of identifiers for the "
181
+ "provided datasets",
141
182
  # full_join
142
183
  "1-1-13-14": "Cannot perform a join over a Dataset Without Identifiers: {name}.",
143
- "1-1-13-15": "At op {op}: {comp_name} has to be a Measure for all the provided datasets inside the join",
184
+ "1-1-13-15": "At op {op}: {comp_name} has to be a Measure for all the provided datasets inside "
185
+ "the join",
144
186
  "1-1-13-16": "At op {op}: Invalid use, please review : {msg}.",
145
- "1-1-13-17": "At op {op}: {comp_name} not present in the dataset(result from join VDS) at the time it is called",
187
+ "1-1-13-17": "At op {op}: {comp_name} not present in the dataset(result from join VDS) at the "
188
+ "time it is called",
146
189
  # Operators general errors
147
190
  "1-1-14-1": "At op {op}: Measure names don't match: {left} - {right}.",
148
- "1-1-14-3": "At op {op}: Invalid scalar types for identifiers at DataSet {dataset}. One {type} identifier expected, {count} found.",
191
+ "1-1-14-3": "At op {op}: Invalid scalar types for identifiers at DataSet {dataset}. One {type} "
192
+ "identifier expected, {count} found.",
149
193
  "1-1-14-5": "At op {op}: {names} with type/s {types} is not compatible with {op}",
150
- "1-1-14-6": "At op {op}: {comp_name} with type {comp_type} and scalar_set with type {scalar_type} is not compatible with {op}",
194
+ "1-1-14-6": "At op {op}: {comp_name} with type {comp_type} and scalar_set with type "
195
+ "{scalar_type} is not compatible with {op}",
151
196
  # "1-1-14-8": "At op {op}: Operation not allowed for multimeasure datasets.",
152
- "1-1-14-9": "At op {op}: {names} with type/s {types} is not compatible with {op} on datasets {datasets}.",
153
-
197
+ "1-1-14-9": "At op {op}: {names} with type/s {types} is not compatible with {op} on datasets "
198
+ "{datasets}.",
154
199
  # Numeric Operators
155
200
  "1-1-15-8": "At op {op}: {op} operator cannot have a {comp_type} as parameter.",
156
- "2-1-15-1": "At op {op}: Component {comp_name} from dataset {dataset_name} contains negative values.",
201
+ "2-1-15-1": "At op {op}: Component {comp_name} from dataset {dataset_name} contains negative "
202
+ "values.",
157
203
  "2-1-15-2": "At op {op}: Value {value} could not be negative.",
158
204
  "2-1-15-3": "At op {op}: Base value {value} could not be less or equal 0.",
159
205
  "2-1-15-4": "At op {op}: Invalid values in Component {name}.",
@@ -161,7 +207,8 @@ centralised_messages = {
161
207
  "2-1-15-6": "At op {op}: Scalar division by Zero.",
162
208
  "2-1-15-7": "At op {op}: {op} operator cannot be a dataset.",
163
209
  # Set Operators
164
- "1-1-17-1": "At op {op}: Datasets {dataset_1} and {dataset_2} have different number of components",
210
+ "1-1-17-1": "At op {op}: Datasets {dataset_1} and {dataset_2} have different number of "
211
+ "components",
165
212
  # String Operators
166
213
  # "1-1-18-1": "At op {op}: Invalid Dataset {name}. Dataset with one measure expected.",
167
214
  "1-1-18-2": "At op {op}: Composition of DataSet and Component is not allowed.",
@@ -174,14 +221,30 @@ centralised_messages = {
174
221
  # Time operators
175
222
  "1-1-19-2": "At op {op}: Unknown date type for {op}.",
176
223
  "1-1-19-3": "At op {op}: Invalid {param} for {op}.",
177
- "1-1-19-4": "At op {op}: Invalid values {value_1} and {value_2}, periodIndTo parameter must be a larger duration value than periodIndFrom parameter.",
178
- "1-1-19-5": "At op {op}: periodIndTo parameter must be a larger duration value than the values to aggregate.",
224
+ "1-1-19-4": "At op {op}: Invalid values {value_1} and {value_2}, periodIndTo parameter must be "
225
+ "a larger duration value than periodIndFrom parameter.",
226
+ "1-1-19-5": "At op {op}: periodIndTo parameter must be a larger duration value than the values "
227
+ "to aggregate.",
179
228
  "1-1-19-6": "At op {op}: Time type used in the component {comp} is not supported.",
180
- "1-1-19-7": "At op {op}: can be applied only on Data Sets (of time series) and returns a Data Set (of time series).",
229
+ "1-1-19-7": "At op {op}: can be applied only on Data Sets (of time series) and returns a Data "
230
+ "Set (of time series).",
181
231
  # flow_to_stock, stock_to_flow
182
232
  "1-1-19-8": "At op {op}: {op} can only be applied to a {comp_type}",
183
233
  "1-1-19-9": "At op {op}: {op} can only be applied to a {comp_type} with a {param}",
184
- "2-1-19-1": "At op {op}: Invalid values {value_1} and {value_2} for duration, periodIndTo parameter must be a larger duration value than the values to aggregate.",
234
+ # Other time operators
235
+ "2-1-19-1": "At op {op}: Invalid values {value_1} and {value_2} for duration, "
236
+ "periodIndTo parameter must be a larger duration value than the "
237
+ "values to aggregate.",
238
+ "2-1-19-2": "Invalid period indicator {period}.",
239
+ "2-1-19-3": "Only same period indicator allowed for both parameters ({period1} != {period2}).",
240
+ "2-1-19-4": "Date setter, ({value} > {date}). Cannot set date1 with a value higher than date2.",
241
+ "2-1-19-5": "Date setter, ({value} < {date}). Cannot set date2 with a value lower than date1.",
242
+ "2-1-19-6": "Invalid period format, must be YYYY-(L)NNN: {period_format}",
243
+ "2-1-19-7": "Period Number must be between 1 and {periods} for period indicator "
244
+ "{period_indicator}.",
245
+ "2-1-19-8": "Invalid date format, must be YYYY-MM-DD: {str}",
246
+ "2-1-19-9": "Invalid day {day} for year {year}.",
247
+ "2-1-19-10": "Invalid year {year}, must be between 1900 and 9999.",
185
248
  # ----------- Interpreter Common ------
186
249
  "2-3-1": "{comp_type} {comp_name} not found.",
187
250
  "2-3-2": "{op_type} cannot be used with {node_op} operators.",
@@ -209,11 +272,14 @@ centralised_messages = {
209
272
  "1-3-21": "Value {value} not valid, kind {node_kind}.",
210
273
  "1-3-22": "Unable to categorize {node_value}.",
211
274
  "1-3-23": "Missing value domain '{name}' definition, please provide an structure.",
212
- "1-3-24": "Internal error on Analytic operators inside a calc, No partition or order symbol found.",
275
+ "1-3-24": "Internal error on Analytic operators inside a calc, No partition or "
276
+ "order symbol found.",
213
277
  "1-3-26": "Value domain {name} not found.",
214
278
  "1-3-27": "Dataset without identifiers are not allowed in {op} operator.",
215
- "1-3-28": "At op {op}: invalid number of parameters: received {received}, expected at least: {expected}",
216
- "1-3-29": "At op {op}: can not use user defined operator that returns a component outside clause operator or rule",
279
+ "1-3-28": "At op {op}: invalid number of parameters: received {received}, expected at "
280
+ "least: {expected}",
281
+ "1-3-29": "At op {op}: can not use user defined operator that returns a component outside "
282
+ "clause operator or rule",
217
283
  "1-3-30": "At op {op}: too many parameters: received {received}, expected: {expected}",
218
284
  "1-3-31": "Cannot use component {name} outside an aggregate function in a having clause.",
219
285
  "1-3-32": "Cannot perform operation {op} inside having clause.",
@@ -225,19 +291,25 @@ centralised_messages = {
225
291
  "1-4-1-1": "At op {op}: User defined {option} declared as {type_1}, found {type_2}.",
226
292
  "1-4-1-2": "Using variable {value}, not defined at {op} definition.",
227
293
  "1-4-1-3": "At op {op}: using variable {value}, not defined as an argument.",
228
- "1-4-1-4": "Found duplicates at arguments naming, please review {type} definition {op}.",
229
- "1-4-1-5": "Found duplicates at rule naming: {names}. Please review {type} {ruleset_name} definition.",
294
+ "1-4-1-4": "Found duplicates at arguments naming, please review {type} " "definition {op}.",
295
+ "1-4-1-5": "Found duplicates at rule naming: {names}. Please review {type} "
296
+ "{ruleset_name} definition.",
230
297
  "1-4-1-6": "At op {op}: Arguments incoherence, {defined} defined {passed} passed.",
231
- "1-4-1-7": "All rules must be named or not named, but found mixed criteria at {type} definition {name}.",
232
- "1-4-1-8": "All rules must have different code items in the left side of '=' in hierarchy operator at hierachical ruleset definition {name}.",
233
- "1-4-1-9": "At op check_datapoint: {name} has an invalid datatype expected DataSet, found Scalar.",
298
+ "1-4-1-7": "All rules must be named or not named, but found mixed criteria at {type} "
299
+ "definition {name}.",
300
+ "1-4-1-8": "All rules must have different code items in the left side of '=' in hierarchy "
301
+ "operator at hierachical ruleset definition {name}.",
302
+ "1-4-1-9": "At op check_datapoint: {name} has an invalid datatype expected DataSet, found "
303
+ "Scalar.",
234
304
  # AST Creation
235
305
  "1-4-2-1": "Eval could not be called without a {option} type definition.",
236
306
  "1-4-2-2": "Optional or empty expression node is not allowed in time_agg.",
237
307
  "1-4-2-3": "{value} could not be called in the count.",
238
- "1-4-2-4": "At op {op}: Only one order_by element must be used in Analytic with range windowing.",
308
+ "1-4-2-4": "At op {op}: Only one order_by element must be used in Analytic with range "
309
+ "windowing.",
239
310
  "1-4-2-5": "At op {op}: User defined operator without returns is not implemented.",
240
311
  "1-4-2-6": "At op {op}: Window must be provided.",
241
- "1-4-2-7": "At op {op}: Partition by or order by clause must be provided for Analytic operators.",
312
+ "1-4-2-7": "At op {op}: Partition by or order by clause must be provided for Analytic "
313
+ "operators.",
242
314
  # Not Implemented Error
243
315
  }