pydpm_xl 0.1.39rc32__py3-none-any.whl → 0.2.0__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.
- py_dpm/__init__.py +1 -1
- py_dpm/api/__init__.py +58 -189
- py_dpm/api/dpm/__init__.py +20 -0
- py_dpm/api/{data_dictionary.py → dpm/data_dictionary.py} +903 -984
- py_dpm/api/dpm/explorer.py +236 -0
- py_dpm/api/dpm/hierarchical_queries.py +142 -0
- py_dpm/api/{migration.py → dpm/migration.py} +16 -19
- py_dpm/api/{operation_scopes.py → dpm/operation_scopes.py} +319 -267
- py_dpm/api/dpm_xl/__init__.py +25 -0
- py_dpm/api/{ast_generator.py → dpm_xl/ast_generator.py} +3 -3
- py_dpm/api/{complete_ast.py → dpm_xl/complete_ast.py} +191 -167
- py_dpm/api/dpm_xl/semantic.py +354 -0
- py_dpm/api/{syntax.py → dpm_xl/syntax.py} +6 -5
- py_dpm/api/explorer.py +4 -0
- py_dpm/api/semantic.py +30 -306
- py_dpm/cli/__init__.py +9 -0
- py_dpm/{client.py → cli/main.py} +8 -8
- py_dpm/dpm/__init__.py +11 -0
- py_dpm/{models.py → dpm/models.py} +112 -88
- py_dpm/dpm/queries/base.py +100 -0
- py_dpm/dpm/queries/basic_objects.py +33 -0
- py_dpm/dpm/queries/explorer_queries.py +352 -0
- py_dpm/dpm/queries/filters.py +139 -0
- py_dpm/dpm/queries/glossary.py +45 -0
- py_dpm/dpm/queries/hierarchical_queries.py +838 -0
- py_dpm/dpm/queries/tables.py +133 -0
- py_dpm/dpm/utils.py +356 -0
- py_dpm/dpm_xl/__init__.py +8 -0
- py_dpm/dpm_xl/ast/__init__.py +14 -0
- py_dpm/{AST/ASTConstructor.py → dpm_xl/ast/constructor.py} +6 -6
- py_dpm/{AST/MLGeneration.py → dpm_xl/ast/ml_generation.py} +137 -87
- py_dpm/{AST/ModuleAnalyzer.py → dpm_xl/ast/module_analyzer.py} +7 -7
- py_dpm/{AST/ModuleDependencies.py → dpm_xl/ast/module_dependencies.py} +56 -41
- py_dpm/{AST/ASTObjects.py → dpm_xl/ast/nodes.py} +1 -1
- py_dpm/{AST/check_operands.py → dpm_xl/ast/operands.py} +16 -13
- py_dpm/{AST/ASTTemplate.py → dpm_xl/ast/template.py} +2 -2
- py_dpm/{AST/WhereClauseChecker.py → dpm_xl/ast/where_clause.py} +2 -2
- py_dpm/dpm_xl/grammar/__init__.py +18 -0
- py_dpm/dpm_xl/operators/__init__.py +19 -0
- py_dpm/{Operators/AggregateOperators.py → dpm_xl/operators/aggregate.py} +7 -7
- py_dpm/{Operators/NumericOperators.py → dpm_xl/operators/arithmetic.py} +6 -6
- py_dpm/{Operators/Operator.py → dpm_xl/operators/base.py} +5 -5
- py_dpm/{Operators/BooleanOperators.py → dpm_xl/operators/boolean.py} +5 -5
- py_dpm/{Operators/ClauseOperators.py → dpm_xl/operators/clause.py} +8 -8
- py_dpm/{Operators/ComparisonOperators.py → dpm_xl/operators/comparison.py} +5 -5
- py_dpm/{Operators/ConditionalOperators.py → dpm_xl/operators/conditional.py} +7 -7
- py_dpm/{Operators/StringOperators.py → dpm_xl/operators/string.py} +5 -5
- py_dpm/{Operators/TimeOperators.py → dpm_xl/operators/time.py} +6 -6
- py_dpm/{semantics/SemanticAnalyzer.py → dpm_xl/semantic_analyzer.py} +168 -68
- py_dpm/{semantics/Symbols.py → dpm_xl/symbols.py} +3 -3
- py_dpm/dpm_xl/types/__init__.py +13 -0
- py_dpm/{DataTypes/TypePromotion.py → dpm_xl/types/promotion.py} +2 -2
- py_dpm/{DataTypes/ScalarTypes.py → dpm_xl/types/scalar.py} +2 -2
- py_dpm/dpm_xl/utils/__init__.py +14 -0
- py_dpm/{data_handlers.py → dpm_xl/utils/data_handlers.py} +2 -2
- py_dpm/{Utils → dpm_xl/utils}/operands_mapping.py +1 -1
- py_dpm/{Utils → dpm_xl/utils}/operator_mapping.py +8 -8
- py_dpm/{OperationScopes/OperationScopeService.py → dpm_xl/utils/scopes_calculator.py} +148 -58
- py_dpm/{Utils/ast_serialization.py → dpm_xl/utils/serialization.py} +2 -2
- py_dpm/dpm_xl/validation/__init__.py +12 -0
- py_dpm/{Utils/ValidationsGenerationUtils.py → dpm_xl/validation/generation_utils.py} +2 -3
- py_dpm/{ValidationsGeneration/PropertiesConstraintsProcessor.py → dpm_xl/validation/property_constraints.py} +56 -21
- py_dpm/{ValidationsGeneration/auxiliary_functions.py → dpm_xl/validation/utils.py} +2 -2
- py_dpm/{ValidationsGeneration/VariantsProcessor.py → dpm_xl/validation/variants.py} +149 -55
- py_dpm/exceptions/__init__.py +23 -0
- py_dpm/{Exceptions → exceptions}/exceptions.py +7 -2
- pydpm_xl-0.2.0.dist-info/METADATA +278 -0
- pydpm_xl-0.2.0.dist-info/RECORD +88 -0
- pydpm_xl-0.2.0.dist-info/entry_points.txt +2 -0
- py_dpm/Exceptions/__init__.py +0 -0
- py_dpm/OperationScopes/__init__.py +0 -0
- py_dpm/Operators/__init__.py +0 -0
- py_dpm/Utils/__init__.py +0 -0
- py_dpm/Utils/utils.py +0 -2
- py_dpm/ValidationsGeneration/Utils.py +0 -364
- py_dpm/ValidationsGeneration/__init__.py +0 -0
- py_dpm/api/data_dictionary_validation.py +0 -614
- py_dpm/db_utils.py +0 -221
- py_dpm/grammar/__init__.py +0 -0
- py_dpm/grammar/dist/__init__.py +0 -0
- py_dpm/grammar/dpm_xlLexer.g4 +0 -437
- py_dpm/grammar/dpm_xlParser.g4 +0 -263
- py_dpm/semantics/DAG/DAGAnalyzer.py +0 -158
- py_dpm/semantics/DAG/__init__.py +0 -0
- py_dpm/semantics/__init__.py +0 -0
- py_dpm/views/data_types.sql +0 -12
- py_dpm/views/datapoints.sql +0 -65
- py_dpm/views/hierarchy_operand_reference.sql +0 -11
- py_dpm/views/hierarchy_preconditions.sql +0 -13
- py_dpm/views/hierarchy_variables.sql +0 -26
- py_dpm/views/hierarchy_variables_context.sql +0 -14
- py_dpm/views/key_components.sql +0 -18
- py_dpm/views/module_from_table.sql +0 -11
- py_dpm/views/open_keys.sql +0 -13
- py_dpm/views/operation_info.sql +0 -27
- py_dpm/views/operation_list.sql +0 -18
- py_dpm/views/operations_versions_from_module_version.sql +0 -30
- py_dpm/views/precondition_info.sql +0 -17
- py_dpm/views/report_type_operand_reference_info.sql +0 -18
- py_dpm/views/subcategory_info.sql +0 -17
- py_dpm/views/table_info.sql +0 -19
- pydpm_xl-0.1.39rc32.dist-info/METADATA +0 -53
- pydpm_xl-0.1.39rc32.dist-info/RECORD +0 -96
- pydpm_xl-0.1.39rc32.dist-info/entry_points.txt +0 -2
- /py_dpm/{AST → cli/commands}/__init__.py +0 -0
- /py_dpm/{migration.py → dpm/migration.py} +0 -0
- /py_dpm/{AST/ASTVisitor.py → dpm_xl/ast/visitor.py} +0 -0
- /py_dpm/{DataTypes → dpm_xl/grammar/generated}/__init__.py +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlLexer.interp +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlLexer.py +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlLexer.tokens +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlParser.interp +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlParser.py +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlParser.tokens +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlParserListener.py +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/dpm_xlParserVisitor.py +0 -0
- /py_dpm/{grammar/dist → dpm_xl/grammar/generated}/listeners.py +0 -0
- /py_dpm/{DataTypes/TimeClasses.py → dpm_xl/types/time.py} +0 -0
- /py_dpm/{Utils → dpm_xl/utils}/tokens.py +0 -0
- /py_dpm/{Exceptions → exceptions}/messages.py +0 -0
- {pydpm_xl-0.1.39rc32.dist-info → pydpm_xl-0.2.0.dist-info}/WHEEL +0 -0
- {pydpm_xl-0.1.39rc32.dist-info → pydpm_xl-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {pydpm_xl-0.1.39rc32.dist-info → pydpm_xl-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
py_dpm/__init__.py,sha256=rbhfed7zNfD34iEi3bPOB9D7x1mpkcUaXZjtqQecZfo,1858
|
|
2
|
+
py_dpm/api/__init__.py,sha256=g0w2FOtETU1ZMuhGnbdgBmmTZwmWoBtBEDmkLR1t8sc,1824
|
|
3
|
+
py_dpm/api/explorer.py,sha256=1dBc2ZidcAR5DfPEBRiyVk54Xv9u_G9mU66u7PA9Z-E,86
|
|
4
|
+
py_dpm/api/semantic.py,sha256=QT0znXXa4ihqk4GmlmJQrdceCRy1o_3J17koW6rT5PE,1304
|
|
5
|
+
py_dpm/api/dpm/__init__.py,sha256=FfyTxv29mxIrdw_y7QOdwwf8p4F9YsdiJ_H7HfL2gJo,528
|
|
6
|
+
py_dpm/api/dpm/data_dictionary.py,sha256=g0h6Yfschz7rboYly9LTbP-2SS5UxltU3AXu0v0tqrU,29457
|
|
7
|
+
py_dpm/api/dpm/explorer.py,sha256=gW2RC59XwGl9YbEA-M4syHAs6MvqPWVw4wR_XdVFJ4Y,7888
|
|
8
|
+
py_dpm/api/dpm/hierarchical_queries.py,sha256=X4AbpsWy3iItOTVIdVbtaTmRgOHPf0Y64Ig-_377uns,4054
|
|
9
|
+
py_dpm/api/dpm/migration.py,sha256=9FT7zzz4QdUIRR6MD01gMODBtfq9HH_RF4hRgZqMcZc,2404
|
|
10
|
+
py_dpm/api/dpm/operation_scopes.py,sha256=Vw9cdPiFM7uCsQyMY1AgT5XhHbxFcVeMwIcIXANuty4,48486
|
|
11
|
+
py_dpm/api/dpm_xl/__init__.py,sha256=rjiIf9XDi2IGf0G_LiOWp29e5ANyoREfzl5Z5phJU_8,603
|
|
12
|
+
py_dpm/api/dpm_xl/ast_generator.py,sha256=-wOgUEM1DMpyVwflkplLr7BOZFfjaDeXi-R_PLhsAxo,16160
|
|
13
|
+
py_dpm/api/dpm_xl/complete_ast.py,sha256=rBfzGQ5RnJXlLcG46jMpArfnllQSPN1ny4Ou_Y_HGAc,31002
|
|
14
|
+
py_dpm/api/dpm_xl/semantic.py,sha256=hbyS0tQITZjeXNid6j4Rvc_PkV-8tfmZrj2_1XlAKwg,13422
|
|
15
|
+
py_dpm/api/dpm_xl/syntax.py,sha256=Ke_kKd9ModoJ6siL3GPT9j9QClmopryCRcdDAT3M5-E,5954
|
|
16
|
+
py_dpm/cli/__init__.py,sha256=UrfGHoQ0sZLjWfA0hoOoI4iTrn-bjr2f9Q8wDWd5nMo,133
|
|
17
|
+
py_dpm/cli/main.py,sha256=UACXaWiPZH6vxfmdasSMTVXAk7IceOcon30qtOugPz4,22304
|
|
18
|
+
py_dpm/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
py_dpm/dpm/__init__.py,sha256=moagUo5Gxf24-Tl9FL_3n2wmVoD_oXtpC-YIGktH_rc,212
|
|
20
|
+
py_dpm/dpm/migration.py,sha256=ivO_ObvKzVomTns6qfo-o5FuciWxkXbMd_gJ4_tu7Xc,14110
|
|
21
|
+
py_dpm/dpm/models.py,sha256=mk0zLUpPHZn5DN2iIFsZ4dJUjgT5b4rroD_Q8W-o_ns,124751
|
|
22
|
+
py_dpm/dpm/utils.py,sha256=JNdAeOXjzQtye94jLPRHHGUMcvkGtTsjA5HFl92rWig,12783
|
|
23
|
+
py_dpm/dpm/queries/base.py,sha256=EddMeJMwtp63DyyIFO7_XxGvdlCtJQWWpeOVImlKp4I,3648
|
|
24
|
+
py_dpm/dpm/queries/basic_objects.py,sha256=JOXC235lMDfVENrFAhZAl7_nqePJ4RrwJhFF0WDyk0M,955
|
|
25
|
+
py_dpm/dpm/queries/explorer_queries.py,sha256=Co8CzdzlDrOL5-ZxY7_HoHPaP_j-xjLDSsB8EKT5aC8,13034
|
|
26
|
+
py_dpm/dpm/queries/filters.py,sha256=fxC2KLYpIvtmuyuJFb0te2ULiyDnQBZfVM79VQnr6qA,4901
|
|
27
|
+
py_dpm/dpm/queries/glossary.py,sha256=2SqKZghQTw-E8NWwHebDHuDC8BC389fGe-0UBIVfJ8Q,1571
|
|
28
|
+
py_dpm/dpm/queries/hierarchical_queries.py,sha256=FYO2p_OxZioynXW4nGCQ3UG3p3uzE28KdsmMaQSk1wk,31538
|
|
29
|
+
py_dpm/dpm/queries/tables.py,sha256=ZaUwvQzj5EXR7BVv2VLYZ7Iii3aMFMlZ3rX25NtBuMg,4411
|
|
30
|
+
py_dpm/dpm_xl/__init__.py,sha256=fN3AvMthyaVC893iza5IMzi3uVuLer411WdmKor6tY4,158
|
|
31
|
+
py_dpm/dpm_xl/semantic_analyzer.py,sha256=vZjtEzCkGNZN20EoU8yDMee8vIwRhDxvN5-JhZFTFhI,15746
|
|
32
|
+
py_dpm/dpm_xl/symbols.py,sha256=XSAiFSffxfPcnGdEDYEMjJrrhEJeuNIeasmHBp5C5Fc,7637
|
|
33
|
+
py_dpm/dpm_xl/ast/__init__.py,sha256=S3ybJrA-IlLkzoO0VdAadBifg6ESn550B1m-TXzSiEE,329
|
|
34
|
+
py_dpm/dpm_xl/ast/constructor.py,sha256=X8l0hedF2HDRSmmT9N0gkFs7ERS6xymvGHWQdtTWyOM,22204
|
|
35
|
+
py_dpm/dpm_xl/ast/ml_generation.py,sha256=Lw_1Btln2x1ewD9xH-2Ea4NJJP3PIqFoivWASX3lcIM,25263
|
|
36
|
+
py_dpm/dpm_xl/ast/module_analyzer.py,sha256=ZnldoYn-s41UMiJpcAV6hjIwH6fssZeOpc564epngg8,2872
|
|
37
|
+
py_dpm/dpm_xl/ast/module_dependencies.py,sha256=tbCqoDcE1n1lJOjtbpD3rNPkXrLk-k2rM5zyVwmsNpc,8355
|
|
38
|
+
py_dpm/dpm_xl/ast/nodes.py,sha256=5ob8MsCW0fPZgz9yP_6IgVTH2SGeoTk5VncJuQ2SgrE,25035
|
|
39
|
+
py_dpm/dpm_xl/ast/operands.py,sha256=xe3MwgJzqxKPzyik1IjAtHqCgBBv_N3rQXqNtAVRDpw,21099
|
|
40
|
+
py_dpm/dpm_xl/ast/template.py,sha256=QhYm7Jh_a-ws3kSmf0hqXFLzB_quO9GgKcmcFe22_fg,3045
|
|
41
|
+
py_dpm/dpm_xl/ast/visitor.py,sha256=yL9UpPMQlq8ToHR8COyFYpuSChnDRjnkQHbCyYX0tsY,509
|
|
42
|
+
py_dpm/dpm_xl/ast/where_clause.py,sha256=g3cslQ8vmlm0doqQ_ghjXzhzItc_xlC_bQ9odn87FGk,328
|
|
43
|
+
py_dpm/dpm_xl/grammar/__init__.py,sha256=NmIQzgGc_4AzAOuLiQUSY9JsEG9h0hYCpw14kmKREME,551
|
|
44
|
+
py_dpm/dpm_xl/grammar/generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlLexer.interp,sha256=ump1PKaPcRFlKTuKQSeBm6407x90lmSky1HP8KWfpjI,56920
|
|
46
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlLexer.py,sha256=d2iJEDuYiizEYErMOfEEAfIl1ObORTAtizwSUH0PpYM,67560
|
|
47
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlLexer.tokens,sha256=-Pj5UlkputKM9b9kMQTLeDCcGIMwAOEeXF8aKiBf30I,1246
|
|
48
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlParser.interp,sha256=aBhwBzsukwdyNGBr7YI9Bgnuf3aUroBMsoGn-UH_LHQ,17617
|
|
49
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlParser.py,sha256=65wE9zBnB4f-ELCCcjkyGRjcn_ef0Yd4_4n0qlcv79I,203789
|
|
50
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlParser.tokens,sha256=-Pj5UlkputKM9b9kMQTLeDCcGIMwAOEeXF8aKiBf30I,1246
|
|
51
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlParserListener.py,sha256=7EDpt2QwuvieqZx1yRLirF_sLaWSkAoM3PjpegQHSLs,24895
|
|
52
|
+
py_dpm/dpm_xl/grammar/generated/dpm_xlParserVisitor.py,sha256=cl6oHKFH0Zr5S1FySykygOojG0CvcLmVUj1vfKmVoMI,14886
|
|
53
|
+
py_dpm/dpm_xl/grammar/generated/listeners.py,sha256=mb7EOwZF_6qExdbUxrZDmXvykJBMlafGoxrPWpY1rz0,334
|
|
54
|
+
py_dpm/dpm_xl/operators/__init__.py,sha256=Y9LmdMFs3k-3IXlpyhH9HYjnN2IZqk6vweVinAyAL0s,553
|
|
55
|
+
py_dpm/dpm_xl/operators/aggregate.py,sha256=4AgPqrYcNYwUkq2_LgYg9CIsYzyeRiBLtQUiU56ePl8,4905
|
|
56
|
+
py_dpm/dpm_xl/operators/arithmetic.py,sha256=FOI3Ielr-_hjmqx34zaK7OJVL1PIZkciQs2A5_swOfw,1775
|
|
57
|
+
py_dpm/dpm_xl/operators/base.py,sha256=hy7_bie5oi5UzHISMVUvFjp6nbsh1btr-x0SyLQfAgM,18899
|
|
58
|
+
py_dpm/dpm_xl/operators/boolean.py,sha256=8PYZEcZ9Pby7-xFeZXTjwAv3-rSo4NXwFDbasUbqKbo,520
|
|
59
|
+
py_dpm/dpm_xl/operators/clause.py,sha256=DjD0Ez5JNaOhXCDZWYRjhK_9SZ3FIV0za5QsA7T9LGI,8625
|
|
60
|
+
py_dpm/dpm_xl/operators/comparison.py,sha256=yMlq6SXh7H3Gydr15oX8UWBjjJMgTuh_ATQmrbeUHZ8,1156
|
|
61
|
+
py_dpm/dpm_xl/operators/conditional.py,sha256=3XNPkVAJsETe0-Ua32nOxadzILqScQQ5Fc8eImEU5Pk,17264
|
|
62
|
+
py_dpm/dpm_xl/operators/string.py,sha256=1exolNby9uaVucTr8Q8Mq2RtfoxZiVP9ORtBYnas5ZM,525
|
|
63
|
+
py_dpm/dpm_xl/operators/time.py,sha256=9MXxvTYsQgwQGJ0o7hF3BtDekxWvUq_cSS95zUCxOvE,2240
|
|
64
|
+
py_dpm/dpm_xl/types/__init__.py,sha256=GU5h5dRFabBDLpnKm-UAUDuOAfNFOzauS5rAgcOqMq0,294
|
|
65
|
+
py_dpm/dpm_xl/types/promotion.py,sha256=NG50ETtTgh0-jYbSfoiGPpgtFYHwcV0cSXUHDbwd5Sw,9585
|
|
66
|
+
py_dpm/dpm_xl/types/scalar.py,sha256=H-9asP2CynqWJ3WtRwjARjbQMWAXjTBdWryZch1ON_M,6878
|
|
67
|
+
py_dpm/dpm_xl/types/time.py,sha256=MmxsHn9sqBCQ-YkTKlGn-yow-Y-XVMRvrUEthqhT0JM,11379
|
|
68
|
+
py_dpm/dpm_xl/utils/__init__.py,sha256=4-jXa7AdHjx2DpikAzjZVKqBktdrHgSAx6pibb4sM_k,331
|
|
69
|
+
py_dpm/dpm_xl/utils/data_handlers.py,sha256=a0E-IaP_-CDKLcj-Gt2ggAziKIOUiwnT2D9IkWCS68o,4402
|
|
70
|
+
py_dpm/dpm_xl/utils/operands_mapping.py,sha256=LG0hPlUuTM2X2uWOtiD6HkmNeDEJkWJ8gV-Fxej_8QM,2241
|
|
71
|
+
py_dpm/dpm_xl/utils/operator_mapping.py,sha256=BFgbVbSCSuutFNHJ4gtgm5VuG38pcl8Kmfi-sefg6JU,1913
|
|
72
|
+
py_dpm/dpm_xl/utils/scopes_calculator.py,sha256=nCx2mz_qtw61BESp38ORQYlF2uRT8SyUKawSX9OQljM,17832
|
|
73
|
+
py_dpm/dpm_xl/utils/serialization.py,sha256=VkjTTcg7okQ9uw1WGsM9xyYGRTrHcDjEuveeS92taxM,32468
|
|
74
|
+
py_dpm/dpm_xl/utils/tokens.py,sha256=VRIrPDi5ttwgH-on5Qt4-l4ho4bLA755-nfTalponcA,3496
|
|
75
|
+
py_dpm/dpm_xl/validation/__init__.py,sha256=pzSTkLzUgK16XsV_maXn__erzs0blDBDRApuRWJwwMs,250
|
|
76
|
+
py_dpm/dpm_xl/validation/generation_utils.py,sha256=2UvYorpLor-8PiEUTWFFVr-xEzKjxQzZrLXz3lvedPk,22655
|
|
77
|
+
py_dpm/dpm_xl/validation/property_constraints.py,sha256=d95p2LxIGGmtGJBz0X14Z4LsS404fvO61VHeAJkN8V8,8272
|
|
78
|
+
py_dpm/dpm_xl/validation/utils.py,sha256=2dV23OJfhDbLYTKkwTUVsXaQeO8zJUs9LbjDXcO5OO4,4196
|
|
79
|
+
py_dpm/dpm_xl/validation/variants.py,sha256=LM_2U_sCf8rnlUyt6k4WQwSKj5eTJLt4Ba8q9VVi4kg,13824
|
|
80
|
+
py_dpm/exceptions/__init__.py,sha256=yDERfUxYW7NUUEiTQChGpuJx6abr7IDe2XUpwVFPtvM,416
|
|
81
|
+
py_dpm/exceptions/exceptions.py,sha256=6S3p-_i5O1oStvSMixt_JQG0xwTeSfBcdzrwL8yBy6Q,2413
|
|
82
|
+
py_dpm/exceptions/messages.py,sha256=UwY6QIK8c-POcDCc9HYbZFGArCIYAanUGNh2LNKPx3U,7534
|
|
83
|
+
pydpm_xl-0.2.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
84
|
+
pydpm_xl-0.2.0.dist-info/METADATA,sha256=O0-W3yLmeS50GBcIt4VBH0cB4tEMApbJS7Vnjxr4u00,7974
|
|
85
|
+
pydpm_xl-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
86
|
+
pydpm_xl-0.2.0.dist-info/entry_points.txt,sha256=6DDmBfw-AjtgvMHgq_I730i_LAAs_7-N3C95HD_bRr4,47
|
|
87
|
+
pydpm_xl-0.2.0.dist-info/top_level.txt,sha256=495PvWZRoKl2NvbQU25W7dqWIBHqY-mFMPt83uxPpcM,7
|
|
88
|
+
pydpm_xl-0.2.0.dist-info/RECORD,,
|
py_dpm/Exceptions/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
py_dpm/Operators/__init__.py
DELETED
|
File without changes
|
py_dpm/Utils/__init__.py
DELETED
|
File without changes
|
py_dpm/Utils/utils.py
DELETED
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import warnings
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
from http.client import BAD_REQUEST, INTERNAL_SERVER_ERROR
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
import pandas as pd
|
|
8
|
-
|
|
9
|
-
from py_dpm.Exceptions.exceptions import ScriptingError, SemanticError
|
|
10
|
-
from py_dpm.models import OperationVersion, SubCategory, TableVersionCell, ViewReportTypeOperandReferenceInfo
|
|
11
|
-
from py_dpm.db_utils import get_session
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def format_table_code(code: str):
|
|
15
|
-
if not code or pd.isna(code):
|
|
16
|
-
return None
|
|
17
|
-
code = code.replace(' ', '_')
|
|
18
|
-
return code
|
|
19
|
-
|
|
20
|
-
def assing_sign(formula):
|
|
21
|
-
if "<" in formula:
|
|
22
|
-
return "negative" # negative
|
|
23
|
-
elif ">" in formula:
|
|
24
|
-
return "positive" # positive
|
|
25
|
-
else:
|
|
26
|
-
return None
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def read_external_sign_data(**kwargs):
|
|
30
|
-
path = Path(__file__).parent / 'utils_report' / 'external_data'
|
|
31
|
-
|
|
32
|
-
eba_rules = path / 'EBA_Validation_Rules_2022-12-12.xlsx'
|
|
33
|
-
sht = '3.2(3.2.1, 3.2.2)' # wb['v3.1(3.1.1)'] # the last one at 21/06/2022
|
|
34
|
-
|
|
35
|
-
eba_df = pd.read_excel(eba_rules, sheet_name=sht)
|
|
36
|
-
sign_validations = eba_df[eba_df['Type'] == 'Sign']
|
|
37
|
-
sign_validations['Table Code'] = sign_validations['T1'].map(lambda x: x.replace(' ', '_'))#map(format_table_code)
|
|
38
|
-
sign_validations["Sign"] = sign_validations["Formula"].map(assing_sign)
|
|
39
|
-
sign_validations = sign_validations[["Table Code", "Sign", "ID"]]
|
|
40
|
-
update_sign_db(sign_validations)
|
|
41
|
-
return sign_validations
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def update_sign_db(sign_validations): # TODO: this does not work because DDL restrictions
|
|
45
|
-
session = get_session()
|
|
46
|
-
# sign_validations = read_external_sign_data()
|
|
47
|
-
neg_tables = sign_validations[sign_validations["Sign"]=='negative']["Table Code"].unique().tolist()
|
|
48
|
-
pos_tables = sign_validations[sign_validations["Sign"]=='positive']["Table Code"].unique().tolist()
|
|
49
|
-
all_neg_table_version_ids = TableVersionCell.get_sign_query(session=session, sign=neg_tables)
|
|
50
|
-
all_pos_table_version_ids = TableVersionCell.get_sign_query(session=session, sign=pos_tables)
|
|
51
|
-
for table_version in all_neg_table_version_ids:
|
|
52
|
-
table_version.Sign = "negative"
|
|
53
|
-
session.commit()
|
|
54
|
-
for table_version in all_pos_table_version_ids:
|
|
55
|
-
table_version.Sign = "positive"
|
|
56
|
-
session.commit()
|
|
57
|
-
|
|
58
|
-
# session.commit()
|
|
59
|
-
session.close()
|
|
60
|
-
|
|
61
|
-
def _error_to_dict(error):
|
|
62
|
-
if isinstance(error, SemanticError):
|
|
63
|
-
status = BAD_REQUEST
|
|
64
|
-
message_error = error.args[0]
|
|
65
|
-
error_code = error.args[1]
|
|
66
|
-
elif isinstance(error, SyntaxError):
|
|
67
|
-
status = BAD_REQUEST
|
|
68
|
-
message_error = error.args[0]
|
|
69
|
-
error_code = "Syntax"
|
|
70
|
-
elif isinstance(error, ScriptingError):
|
|
71
|
-
status = BAD_REQUEST
|
|
72
|
-
message_error = error.args[0]
|
|
73
|
-
error_code = error.args[1]
|
|
74
|
-
else:
|
|
75
|
-
status = INTERNAL_SERVER_ERROR
|
|
76
|
-
message_error = str(error)
|
|
77
|
-
now = datetime.now()
|
|
78
|
-
warnings.warn(f"[{now}] Unhandled exception:\n{error}", RuntimeWarning)
|
|
79
|
-
error_code = "Other"
|
|
80
|
-
|
|
81
|
-
return status, message_error, error_code
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class ExternalData:
|
|
85
|
-
|
|
86
|
-
def __init__(self):
|
|
87
|
-
self.proposed_rules, self.rejected_rules = self.read_external_data()
|
|
88
|
-
|
|
89
|
-
def read_external_data(self, **kwargs):
|
|
90
|
-
path = Path(__file__).parent / 'utils_report' / 'external_data'
|
|
91
|
-
|
|
92
|
-
proposed_rules_path = path / 'out_put_proposed_rules.xlsx'
|
|
93
|
-
rejected_rules_path = path / 'RejectedRuleProposals.csv'
|
|
94
|
-
proposed_rules = pd.read_excel(proposed_rules_path)
|
|
95
|
-
rejected_rules = pd.read_csv(rejected_rules_path, encoding='latin-1')
|
|
96
|
-
return proposed_rules, rejected_rules
|
|
97
|
-
|
|
98
|
-
@staticmethod
|
|
99
|
-
def get_expression_from_code(code: str):
|
|
100
|
-
if not code or pd.isna(code):
|
|
101
|
-
return None
|
|
102
|
-
sql_session = get_session()
|
|
103
|
-
expression = OperationVersion.get_operations_from_code(sql_session, code)
|
|
104
|
-
expression = expression["Expression"].iloc[0] # TODO check if there is more than one expression take the last one maybe
|
|
105
|
-
sql_session.close()
|
|
106
|
-
return expression
|
|
107
|
-
|
|
108
|
-
@classmethod
|
|
109
|
-
def create_report(cls, report_df:pd.DataFrame, info_dict:dict, path:Path, name_report:str):
|
|
110
|
-
path_info = path / f"{name_report}_info.json"
|
|
111
|
-
path_validations = path / f"{name_report}_validations.csv"
|
|
112
|
-
report_df.to_csv(path_validations, index=False)
|
|
113
|
-
with open(path_info, 'w') as f:
|
|
114
|
-
f.write(json.dumps(info_dict))
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
class ExternalDataHierarchies(ExternalData):
|
|
118
|
-
|
|
119
|
-
def __init__(self):
|
|
120
|
-
super().__init__()
|
|
121
|
-
# self.proposed_rules = self.proposed_rules.rename(columns={'HierarchyCode':'Hierarchy Code'})
|
|
122
|
-
self.proposed_rules = self.proposed_rules.dropna(subset=['Hierarchy Code']).reset_index(drop=True)
|
|
123
|
-
self.rejected_rules = self.rejected_rules.dropna(subset=['HierarchyCode']).reset_index(drop=True)
|
|
124
|
-
|
|
125
|
-
def get_hierarchy_subcategory(self, subcategory_code):
|
|
126
|
-
proposed_rules, rejected_rules = self.proposed_rules, self.rejected_rules
|
|
127
|
-
|
|
128
|
-
proposed_rules = proposed_rules[proposed_rules['Hierarchy Code'] == subcategory_code]
|
|
129
|
-
rejected_rules = rejected_rules[rejected_rules['HierarchyCode'] == subcategory_code]
|
|
130
|
-
|
|
131
|
-
return proposed_rules, rejected_rules
|
|
132
|
-
|
|
133
|
-
def compare_all_hierarchies_report(self, validations: list):
|
|
134
|
-
total_number_of_validations_created = 0
|
|
135
|
-
total_number_of_validations_proposed = 0
|
|
136
|
-
total_number_of_validations_rejected = 0
|
|
137
|
-
total_matches_codes = 0
|
|
138
|
-
total_duplicated_codes = 0
|
|
139
|
-
total_codes_dont_match_with_proposed = 0
|
|
140
|
-
total_missing_codes = 0
|
|
141
|
-
total_expressions_dont_match_with_proposed = 0
|
|
142
|
-
sql_session = get_session()
|
|
143
|
-
subcategory_codes = SubCategory.get_codes(session=sql_session)
|
|
144
|
-
sql_session.close()
|
|
145
|
-
subcategory_codes = [subcategory_code[0] for subcategory_code in subcategory_codes]
|
|
146
|
-
total_info = {}
|
|
147
|
-
total_merged = pd.DataFrame()
|
|
148
|
-
for subcategory_code in subcategory_codes:
|
|
149
|
-
validations_subcategory = [elto for elto in validations if elto['subcategory_code'] == subcategory_code]
|
|
150
|
-
merged, info = self.compare_hierarchies_report(validations_subcategory, subcategory_code)
|
|
151
|
-
total_merged = pd.concat([total_merged, merged])
|
|
152
|
-
for key, value in info.items():
|
|
153
|
-
total_info[key] = value
|
|
154
|
-
total_number_of_validations_created += value["number_of_validations_created"]
|
|
155
|
-
total_number_of_validations_proposed += value["number_of_validations_proposed"]
|
|
156
|
-
total_number_of_validations_rejected += value["number_of_validations_rejected"]
|
|
157
|
-
total_matches_codes += len(value["matches_codes(generated_expressions)"])
|
|
158
|
-
if "errors" in value.keys():
|
|
159
|
-
total_duplicated_codes += len(value["errors"]["duplicated_codes"])
|
|
160
|
-
total_codes_dont_match_with_proposed += len(value["errors"]["codes_dont_match_with_proposed"])
|
|
161
|
-
total_missing_codes += len(value["errors"]["missing_codes"])
|
|
162
|
-
total_expressions_dont_match_with_proposed += len(value["errors"]["expressions_dont_match_with_proposed"])
|
|
163
|
-
|
|
164
|
-
# aditional actions on total info
|
|
165
|
-
description = {}
|
|
166
|
-
description["total_number_of_validations_created"] = total_number_of_validations_created
|
|
167
|
-
description["total_number_of_validations_proposed"] = total_number_of_validations_proposed
|
|
168
|
-
description["total_number_of_validations_rejected"] = total_number_of_validations_rejected
|
|
169
|
-
description["total_matches_codes(generated_expressions)"] = total_matches_codes
|
|
170
|
-
description["total_duplicated_codes"] = total_duplicated_codes
|
|
171
|
-
description["total_codes_dont_match_with_proposed"] = total_codes_dont_match_with_proposed
|
|
172
|
-
description["total_missing_codes"] = total_missing_codes
|
|
173
|
-
description["total_expressions_dont_match_with_proposed"] = total_expressions_dont_match_with_proposed
|
|
174
|
-
final_info = {}
|
|
175
|
-
final_info["resume"] = description
|
|
176
|
-
final_info["subcategories"] = total_info
|
|
177
|
-
|
|
178
|
-
return total_merged, final_info
|
|
179
|
-
|
|
180
|
-
def compare_hierarchies_report(self, validations: list, subcategory_code: str):
|
|
181
|
-
proposed, rejected = self.get_hierarchy_subcategory(subcategory_code=subcategory_code)
|
|
182
|
-
proposed_specific = pd.DataFrame(columns=['ID', 'Formula', 'ProposedAction', 'Review Action', 'Hierarchy Code']) if proposed.empty else proposed[['ID', 'Formula', 'ProposedAction', 'Review Action', 'Hierarchy Code']]
|
|
183
|
-
rejected_specific = pd.DataFrame(columns=['ID', 'Formula', 'ProposedAction', 'Review Action', 'Hierarchy Code']) if rejected.empty else rejected[['ID', 'Formula', 'ProposedAction', 'ReviewAction', 'HierarchyCode']].rename(columns={'HierarchyCode':'Hierarchy Code', 'ReviewAction':'Review Action'})
|
|
184
|
-
info = {}
|
|
185
|
-
errors = {}
|
|
186
|
-
errors[subcategory_code] = {}
|
|
187
|
-
errors[subcategory_code]['duplicated_codes'] = []
|
|
188
|
-
|
|
189
|
-
proposed_codes = proposed_specific[~proposed_specific['ID'].isna()]["ID"].unique().tolist()
|
|
190
|
-
rejected_codes = rejected_specific['ID'].unique().tolist()
|
|
191
|
-
total_external = pd.concat([proposed_specific, rejected_specific])
|
|
192
|
-
total_external_codes = total_external['ID'].unique().tolist()
|
|
193
|
-
# validations_codes
|
|
194
|
-
validations_codes = []
|
|
195
|
-
|
|
196
|
-
[validations_codes.extend(elto['operation_code']) for elto in validations]
|
|
197
|
-
|
|
198
|
-
if len(validations_codes) != len(set(validations_codes)):
|
|
199
|
-
errors[subcategory_code]['duplicated_codes'] = list(set([code for code in validations_codes if validations_codes.count(code) > 1]))
|
|
200
|
-
validations_codes = list(set(validations_codes))
|
|
201
|
-
|
|
202
|
-
errors[subcategory_code]['codes_dont_match_with_proposed'] = [code for code in validations_codes if code not in total_external_codes] # TODO
|
|
203
|
-
errors[subcategory_code]['missing_codes'] = [code for code in proposed_codes if code not in validations_codes]
|
|
204
|
-
|
|
205
|
-
#create comparative report
|
|
206
|
-
#first adapt validations
|
|
207
|
-
validations_to_df = []
|
|
208
|
-
errors[subcategory_code]['expressions_dont_match_with_proposed'] = []
|
|
209
|
-
|
|
210
|
-
for elto in validations:
|
|
211
|
-
is_duplicated = False
|
|
212
|
-
if len(elto['operation_code']) == 0:
|
|
213
|
-
if elto['expression'] not in errors[subcategory_code]['expressions_dont_match_with_proposed']:
|
|
214
|
-
errors[subcategory_code]['expressions_dont_match_with_proposed'].append(elto['expression'])
|
|
215
|
-
validations_to_df.append(
|
|
216
|
-
{'code':None, 'expression':elto['expression'], 'status':elto['status'],
|
|
217
|
-
'subcategory_code':subcategory_code, 'is_duplicated':is_duplicated
|
|
218
|
-
}
|
|
219
|
-
)
|
|
220
|
-
if len(set(elto['operation_code'])) > 1:
|
|
221
|
-
is_duplicated = True
|
|
222
|
-
errors[subcategory_code]['duplicated_codes'].extend(elto['operation_code'])
|
|
223
|
-
|
|
224
|
-
for op_code in elto['operation_code']:
|
|
225
|
-
validations_to_df.append(
|
|
226
|
-
{'code':op_code, 'expression':elto['expression'], 'status':elto['status'],
|
|
227
|
-
'subcategory_code':subcategory_code, 'is_duplicated':is_duplicated
|
|
228
|
-
}
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
info[subcategory_code] = {'number_of_validations_created':len(validations)}
|
|
232
|
-
info[subcategory_code]['number_of_validations_proposed'] = len(proposed_specific)
|
|
233
|
-
info[subcategory_code]['number_of_validations_rejected'] = len(rejected_specific)
|
|
234
|
-
comparative_report = pd.DataFrame(validations_to_df)
|
|
235
|
-
if comparative_report.empty:
|
|
236
|
-
comparative_report = pd.DataFrame(columns=['code', 'expression', 'status', 'subcategory_code', 'is_duplicated'])
|
|
237
|
-
|
|
238
|
-
merged = comparative_report.merge(total_external, left_on='code', right_on='ID', how='outer', indicator=True)
|
|
239
|
-
info[subcategory_code]['matches_codes(generated_expressions)'] = merged[~merged['code'].isna()]["code"].unique().tolist()
|
|
240
|
-
# external_code, external_expression, proposed action, code, expression, ...
|
|
241
|
-
|
|
242
|
-
# if not merged.empty:
|
|
243
|
-
merged["expression_from_db"] = merged["code"].map(ExternalData.get_expression_from_code)
|
|
244
|
-
del merged['_merge']
|
|
245
|
-
errors[subcategory_code]['duplicated_codes'] = list(set(errors[subcategory_code]['duplicated_codes']))
|
|
246
|
-
info[subcategory_code]["errors"] = errors[subcategory_code] # TODO
|
|
247
|
-
proposed_expressions_without_code = proposed_specific[proposed_specific['ID'].isna()]["Formula"].unique().tolist()
|
|
248
|
-
if proposed_expressions_without_code:
|
|
249
|
-
info[subcategory_code]['proposed_expressions_without_code'] = proposed_expressions_without_code
|
|
250
|
-
info[subcategory_code]['aditional info']=[{elto["expression"]:elto["aproximated_operations"]} for elto in validations if not elto["operation_code"]]
|
|
251
|
-
return merged, info
|
|
252
|
-
|
|
253
|
-
# @staticmethod
|
|
254
|
-
# def create_report(report_df:pd.DataFrame, info_dict:dict, subcategory_code:str=None):
|
|
255
|
-
# name_report = subcategory_code if subcategory_code else 'all_subcategories'
|
|
256
|
-
# path = Path(__file__).parent / 'utils_report' / 'hierarchies_report'
|
|
257
|
-
# path_errors = path / f"{name_report}_info.json"
|
|
258
|
-
# path_validations = path / f"{name_report}_validations.csv"
|
|
259
|
-
# report_df.to_csv(path_validations, index=False)
|
|
260
|
-
# with open(path_errors, 'w') as f:
|
|
261
|
-
# f.write(json.dumps(info_dict))
|
|
262
|
-
|
|
263
|
-
@classmethod
|
|
264
|
-
def create_report(cls, report_df:pd.DataFrame, info_dict:dict, subcategory_code:str=None):
|
|
265
|
-
name_report = subcategory_code if subcategory_code else 'all_subcategories'
|
|
266
|
-
path = Path(__file__).parent / 'utils_report' / 'hierarchies_report'
|
|
267
|
-
super().create_report(report_df, info_dict, path, name_report)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
class ExternalDataSign(ExternalData):
|
|
271
|
-
|
|
272
|
-
def __init__(self):
|
|
273
|
-
super().__init__()
|
|
274
|
-
self.proposed_rules = self.proposed_rules[self.proposed_rules['Type']=="Sign"]
|
|
275
|
-
self.rejected_rules = self.rejected_rules[self.rejected_rules['Type']=="Sign"]
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
def match_code(self, validations: list, report_type: str):
|
|
279
|
-
"""
|
|
280
|
-
"""
|
|
281
|
-
for elto in validations:
|
|
282
|
-
total_cells_id = elto["cell_data"]
|
|
283
|
-
sql_session = get_session()
|
|
284
|
-
matched_codes = ViewReportTypeOperandReferenceInfo.get_cell_report_operations(sql_session, total_cells_id, report_type)
|
|
285
|
-
elto["operation_code"] = matched_codes
|
|
286
|
-
sql_session.close()
|
|
287
|
-
# new version end
|
|
288
|
-
|
|
289
|
-
return validations
|
|
290
|
-
|
|
291
|
-
def compare_all_sign_report(self, validations: list):
|
|
292
|
-
proposed, rejected = self.proposed_rules, self.rejected_rules
|
|
293
|
-
proposed_specific = pd.DataFrame(columns=['ID', 'Formula', 'ProposedAction', 'Review Action', 'Framework']) if proposed.empty else proposed[['ID', 'Formula', 'ProposedAction', 'Review Action', 'Framework']]
|
|
294
|
-
rejected_specific = pd.DataFrame(columns=['ID', 'Formula', 'ProposedAction', 'Review Action']) if rejected.empty else rejected[['ID', 'Formula', 'ProposedAction', 'ReviewAction']].rename(columns={'ReviewAction':'Review Action'})
|
|
295
|
-
info = {}
|
|
296
|
-
errors = {}
|
|
297
|
-
|
|
298
|
-
proposed_codes = proposed_specific[~proposed_specific['ID'].isna()]["ID"].unique().tolist()
|
|
299
|
-
rejected_codes = rejected_specific['ID'].unique().tolist()
|
|
300
|
-
total_external = pd.concat([proposed_specific, rejected_specific])
|
|
301
|
-
total_external_codes = total_external['ID'].unique().tolist()
|
|
302
|
-
# validations_codes
|
|
303
|
-
validations_codes = []
|
|
304
|
-
|
|
305
|
-
[validations_codes.extend(elto['operation_code']) for elto in validations]
|
|
306
|
-
|
|
307
|
-
if len(validations_codes) != len(set(validations_codes)):
|
|
308
|
-
errors['duplicated_codes'] = list(set([code for code in validations_codes if validations_codes.count(code) > 1]))
|
|
309
|
-
validations_codes = list(set(validations_codes))
|
|
310
|
-
|
|
311
|
-
# no match expressions
|
|
312
|
-
errors['expressions_dont_match_with_proposed'] = [elto['expression'] for elto in validations if len(elto['operation_code']) == 0]
|
|
313
|
-
# missing codes
|
|
314
|
-
errors['missing_codes'] = [code for code in total_external_codes if code not in validations_codes]
|
|
315
|
-
# exceded codes
|
|
316
|
-
errors['exceded_codes'] = [code for code in validations_codes if code not in total_external_codes]
|
|
317
|
-
|
|
318
|
-
validations_to_df = []
|
|
319
|
-
for elto in validations:
|
|
320
|
-
if len(elto['operation_code']) == 0:
|
|
321
|
-
validations_to_df.append(
|
|
322
|
-
{'code':None, 'expression':elto['expression'], 'status':elto['status'],
|
|
323
|
-
'table':None
|
|
324
|
-
}
|
|
325
|
-
)
|
|
326
|
-
elif len(elto['operation_code']) == 1:
|
|
327
|
-
validations_to_df.append(
|
|
328
|
-
{'code':elto['operation_code'][0], 'expression':elto['expression'], 'status':elto['status'],
|
|
329
|
-
'table':None
|
|
330
|
-
}
|
|
331
|
-
)
|
|
332
|
-
else:
|
|
333
|
-
for code in elto['operation_code']:
|
|
334
|
-
validations_to_df.append(
|
|
335
|
-
{'code':code, 'expression':elto['expression'], 'status':elto['status'],
|
|
336
|
-
'table':None
|
|
337
|
-
}
|
|
338
|
-
)
|
|
339
|
-
comparative_report = pd.DataFrame(validations_to_df)
|
|
340
|
-
if comparative_report.empty:
|
|
341
|
-
comparative_report = pd.DataFrame(columns=['code', 'expression', 'status', 'subcategory_code', 'is_duplicated'])
|
|
342
|
-
|
|
343
|
-
merged = comparative_report.merge(total_external, left_on='code', right_on='ID', how='outer', indicator=True)
|
|
344
|
-
merged["expression_from_db"] = merged["code"].map(ExternalData.get_expression_from_code)
|
|
345
|
-
del merged['_merge']
|
|
346
|
-
# total_merged, total_info = proposed_specific, rejected_specific
|
|
347
|
-
|
|
348
|
-
return merged, errors
|
|
349
|
-
|
|
350
|
-
@classmethod
|
|
351
|
-
def create_report(cls, report_df:pd.DataFrame, info_dict:dict):
|
|
352
|
-
name_report = 'signes'
|
|
353
|
-
path = Path(__file__).parent / 'utils_report' / 'signes_report'
|
|
354
|
-
super().create_report(report_df, info_dict, path, name_report)
|
|
355
|
-
|
|
356
|
-
class ExternalDataExistence(ExternalData):
|
|
357
|
-
|
|
358
|
-
def __init__(self):
|
|
359
|
-
super().__init__()
|
|
360
|
-
self.proposed_rules = self.proposed_rules[self.proposed_rules['Type']=="Existence"]
|
|
361
|
-
self.rejected_rules = self.rejected_rules[self.rejected_rules['Type']=="Existence"]
|
|
362
|
-
|
|
363
|
-
def compare_all_existence_report(self, validations: list):
|
|
364
|
-
pass
|
|
File without changes
|