pydpm_xl 0.2.11__tar.gz → 0.2.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. {pydpm_xl-0.2.11/pydpm_xl.egg-info → pydpm_xl-0.2.13}/PKG-INFO +1 -1
  2. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/__init__.py +1 -1
  3. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm_xl/ast_generator.py +38 -0
  4. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/utils/serialization.py +24 -6
  5. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13/pydpm_xl.egg-info}/PKG-INFO +1 -1
  6. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/pyproject.toml +2 -2
  7. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/LICENSE +0 -0
  8. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/README.md +0 -0
  9. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/__init__.py +0 -0
  10. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm/__init__.py +0 -0
  11. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm/data_dictionary.py +0 -0
  12. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm/explorer.py +0 -0
  13. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm/hierarchical_queries.py +0 -0
  14. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm/instance.py +0 -0
  15. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm/migration.py +0 -0
  16. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm_xl/__init__.py +0 -0
  17. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm_xl/complete_ast.py +0 -0
  18. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm_xl/operation_scopes.py +0 -0
  19. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm_xl/semantic.py +0 -0
  20. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/api/dpm_xl/syntax.py +0 -0
  21. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/cli/__init__.py +0 -0
  22. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/cli/commands/__init__.py +0 -0
  23. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/cli/main.py +0 -0
  24. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/__init__.py +0 -0
  25. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/migration.py +0 -0
  26. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/models.py +0 -0
  27. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/queries/base.py +0 -0
  28. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/queries/basic_objects.py +0 -0
  29. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/queries/explorer_queries.py +0 -0
  30. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/queries/filters.py +0 -0
  31. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/queries/glossary.py +0 -0
  32. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/queries/hierarchical_queries.py +0 -0
  33. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/queries/tables.py +0 -0
  34. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm/utils.py +0 -0
  35. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/__init__.py +0 -0
  36. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/__init__.py +0 -0
  37. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/constructor.py +0 -0
  38. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/ml_generation.py +0 -0
  39. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/module_analyzer.py +0 -0
  40. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/module_dependencies.py +0 -0
  41. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/nodes.py +0 -0
  42. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/operands.py +0 -0
  43. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/template.py +0 -0
  44. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/visitor.py +0 -0
  45. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/ast/where_clause.py +0 -0
  46. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/__init__.py +0 -0
  47. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/__init__.py +0 -0
  48. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlLexer.interp +0 -0
  49. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlLexer.py +0 -0
  50. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlLexer.tokens +0 -0
  51. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlParser.interp +0 -0
  52. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlParser.py +0 -0
  53. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlParser.tokens +0 -0
  54. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlParserListener.py +0 -0
  55. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/dpm_xlParserVisitor.py +0 -0
  56. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/grammar/generated/listeners.py +0 -0
  57. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/__init__.py +0 -0
  58. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/aggregate.py +0 -0
  59. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/arithmetic.py +0 -0
  60. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/base.py +0 -0
  61. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/boolean.py +0 -0
  62. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/clause.py +0 -0
  63. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/comparison.py +0 -0
  64. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/conditional.py +0 -0
  65. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/string.py +0 -0
  66. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/operators/time.py +0 -0
  67. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/semantic_analyzer.py +0 -0
  68. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/symbols.py +0 -0
  69. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/types/__init__.py +0 -0
  70. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/types/promotion.py +0 -0
  71. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/types/scalar.py +0 -0
  72. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/types/time.py +0 -0
  73. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/utils/__init__.py +0 -0
  74. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/utils/data_handlers.py +0 -0
  75. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/utils/operands_mapping.py +0 -0
  76. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/utils/operator_mapping.py +0 -0
  77. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/utils/scopes_calculator.py +0 -0
  78. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/dpm_xl/utils/tokens.py +0 -0
  79. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/exceptions/__init__.py +0 -0
  80. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/exceptions/exceptions.py +0 -0
  81. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/exceptions/messages.py +0 -0
  82. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/instance/__init__.py +0 -0
  83. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/py_dpm/instance/instance.py +0 -0
  84. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/pydpm_xl.egg-info/SOURCES.txt +0 -0
  85. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/pydpm_xl.egg-info/dependency_links.txt +0 -0
  86. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/pydpm_xl.egg-info/entry_points.txt +0 -0
  87. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/pydpm_xl.egg-info/requires.txt +0 -0
  88. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/pydpm_xl.egg-info/top_level.txt +0 -0
  89. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/setup.cfg +0 -0
  90. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_cli_semantic.py +0 -0
  91. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_data_dictionary_releases.py +0 -0
  92. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_db_connection_handling.py +0 -0
  93. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_get_table_details.py +0 -0
  94. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_get_tables_date_filter.py +0 -0
  95. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_get_tables_release_code.py +0 -0
  96. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_hierarchical_query.py +0 -0
  97. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_migration_type_inference.py +0 -0
  98. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_query_refactor.py +0 -0
  99. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_release_filters_semantic.py +0 -0
  100. {pydpm_xl-0.2.11 → pydpm_xl-0.2.13}/tests/test_semantic_release.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydpm_xl
3
- Version: 0.2.11
3
+ Version: 0.2.13
4
4
  Summary: Python library for DPM-XL data processing and analysis
5
5
  Author-email: "MeaningfulData S.L." <info@meaningfuldata.eu>
6
6
  License: GPL-3.0-or-later
@@ -41,7 +41,7 @@ Available packages:
41
41
  - pydpm.api: Main APIs for migration, syntax, and semantic analysis
42
42
  """
43
43
 
44
- __version__ = "0.2.11"
44
+ __version__ = "0.2.13"
45
45
  __author__ = "MeaningfulData S.L."
46
46
  __email__ = "info@meaningfuldata.eu"
47
47
  __license__ = "GPL-3.0-or-later"
@@ -358,6 +358,7 @@ class ASTGeneratorAPI:
358
358
  module_code: Optional[str] = None,
359
359
  preferred_module_dependencies: Optional[List[str]] = None,
360
360
  module_version_number: Optional[str] = None,
361
+ add_all_tables: bool = True,
361
362
  ) -> Dict[str, Any]:
362
363
  """
363
364
  Generate validations script with engine-ready AST and framework structure.
@@ -413,6 +414,10 @@ class ASTGeneratorAPI:
413
414
  Mutually exclusive with release_code and release_id.
414
415
  If none of release_code, release_id, or module_version_number are provided,
415
416
  the latest (active) module version is used.
417
+ add_all_tables: If True (default), include all tables and variables from the
418
+ module version in the output, regardless of whether they are referenced in
419
+ the validations. If False, only include tables and variables that are
420
+ actually referenced in the expressions.
416
421
 
417
422
  Returns:
418
423
  dict: {
@@ -483,6 +488,7 @@ class ASTGeneratorAPI:
483
488
  primary_module_vid=primary_module_vid,
484
489
  module_code=module_code,
485
490
  preferred_module_dependencies=preferred_module_dependencies,
491
+ add_all_tables=add_all_tables,
486
492
  )
487
493
 
488
494
  # Save to file if output_path is provided
@@ -960,6 +966,7 @@ class ASTGeneratorAPI:
960
966
  primary_module_vid: Optional[int] = None,
961
967
  module_code: Optional[str] = None,
962
968
  preferred_module_dependencies: Optional[List[str]] = None,
969
+ add_all_tables: bool = True,
963
970
  ) -> Dict[str, Any]:
964
971
  """
965
972
  Add framework structure for multiple expressions (operations, variables, tables, preconditions).
@@ -975,6 +982,8 @@ class ASTGeneratorAPI:
975
982
  primary_module_vid: Module VID being exported (to identify external dependencies)
976
983
  module_code: Optional module code to specify the main module
977
984
  preferred_module_dependencies: Optional list of module codes to prefer for dependencies
985
+ add_all_tables: If True, include all tables and variables from the module version.
986
+ If False, only include tables referenced in expressions.
978
987
 
979
988
  Returns:
980
989
  Dict with the enriched AST structure
@@ -1208,6 +1217,35 @@ class ASTGeneratorAPI:
1208
1217
  if not cross_deps:
1209
1218
  all_intra_instance_ops.append(operation_code)
1210
1219
 
1220
+ # After processing all expressions, add remaining tables from the module if requested
1221
+ if add_all_tables and primary_module_info:
1222
+ resolved_module_vid = primary_module_info.get("module_vid")
1223
+ if resolved_module_vid:
1224
+ # Get all tables belonging to the primary module
1225
+ module_tables = data_dict_api.get_all_tables_for_module(resolved_module_vid)
1226
+
1227
+ for table_info in module_tables:
1228
+ table_code = table_info.get("table_code")
1229
+ table_vid = table_info.get("table_vid")
1230
+
1231
+ # Skip if already added from expressions
1232
+ if table_code in all_tables:
1233
+ continue
1234
+
1235
+ # Get all variables for this table
1236
+ table_variables = data_dict_api.get_all_variables_for_table(table_vid)
1237
+
1238
+ # Query open keys for this table
1239
+ open_keys_list = data_dict_api.get_open_keys_for_table(table_code, release_id)
1240
+ open_keys = {item["property_code"]: item["data_type_code"] for item in open_keys_list}
1241
+
1242
+ all_tables[table_code] = {"variables": table_variables, "open_keys": open_keys}
1243
+ all_variables.update(table_variables)
1244
+
1245
+ # If we added any tables, mark that we have primary module operations
1246
+ if module_tables:
1247
+ has_primary_module_operation = True
1248
+
1211
1249
  finally:
1212
1250
  data_dict_api.close()
1213
1251
 
@@ -406,19 +406,37 @@ class ASTToJSONVisitor(NodeVisitor):
406
406
  }
407
407
 
408
408
  def visit_GetOp(self, node):
409
- """Visit GetOp nodes."""
409
+ """Visit GetOp nodes and serialize as GetClauseOp."""
410
410
  result = {
411
- 'class_name': 'GetOp',
411
+ 'class_name': 'GetClauseOp',
412
412
  'operand': self.visit(node.operand),
413
413
  'component': node.component
414
414
  }
415
415
 
416
- # Include property_id if present (required by adam-engine)
417
- if hasattr(node, 'property_id') and node.property_id is not None:
418
- result['property_id'] = node.property_id
419
-
420
416
  return result
421
417
 
418
+ def visit_SubOp(self, node):
419
+ """Visit SubOp nodes and serialize as SubClauseOp."""
420
+ # Create a Dimension node for the property_code
421
+ dimension = {
422
+ 'class_name': 'Dimension',
423
+ 'dimension_code': node.property_code
424
+ }
425
+
426
+ # Create a BinOp with "=" operator
427
+ condition = {
428
+ 'class_name': 'BinOp',
429
+ 'op': '=',
430
+ 'left': dimension,
431
+ 'right': self.visit(node.value)
432
+ }
433
+
434
+ return {
435
+ 'class_name': 'SubClauseOp',
436
+ 'operand': self.visit(node.operand),
437
+ 'condition': condition
438
+ }
439
+
422
440
  def visit_WhereClauseOp(self, node):
423
441
  """Visit WhereClauseOp nodes."""
424
442
  return {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydpm_xl
3
- Version: 0.2.11
3
+ Version: 0.2.13
4
4
  Summary: Python library for DPM-XL data processing and analysis
5
5
  Author-email: "MeaningfulData S.L." <info@meaningfuldata.eu>
6
6
  License: GPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pydpm_xl"
3
- version = "0.2.11"
3
+ version = "0.2.13"
4
4
  description = "Python library for DPM-XL data processing and analysis"
5
5
  authors = [
6
6
  {name = "MeaningfulData S.L.", email = "info@meaningfuldata.eu"}
@@ -52,7 +52,7 @@ exclude = []
52
52
 
53
53
  [tool.poetry]
54
54
  name = "pydpm_xl"
55
- version = "0.2.11"
55
+ version = "0.2.13"
56
56
  description = "Python library for DPM-XL data processing and analysis"
57
57
  authors = ["MeaningfulData S.L. <info@meaningfuldata.eu>"]
58
58
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes