industrial-model 0.1.0__tar.gz → 0.1.2__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 (39) hide show
  1. {industrial_model-0.1.0 → industrial_model-0.1.2}/PKG-INFO +1 -1
  2. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/schemas.py +11 -7
  3. {industrial_model-0.1.0 → industrial_model-0.1.2}/pyproject.toml +1 -1
  4. {industrial_model-0.1.0 → industrial_model-0.1.2}/.gitignore +0 -0
  5. {industrial_model-0.1.0 → industrial_model-0.1.2}/.python-version +0 -0
  6. {industrial_model-0.1.0 → industrial_model-0.1.2}/README.md +0 -0
  7. {industrial_model-0.1.0 → industrial_model-0.1.2}/assets/logo.jpeg +0 -0
  8. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/__init__.py +0 -0
  9. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/__init__.py +0 -0
  10. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/filter_mapper.py +0 -0
  11. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/optimizer.py +0 -0
  12. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/query_mapper.py +0 -0
  13. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/query_result_mapper.py +0 -0
  14. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/sort_mapper.py +0 -0
  15. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/utils.py +0 -0
  16. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/cognite_adapters/view_mapper.py +0 -0
  17. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/config.py +0 -0
  18. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/constants.py +0 -0
  19. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/engines/__init__.py +0 -0
  20. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/engines/async_engine.py +0 -0
  21. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/engines/engine.py +0 -0
  22. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/models/__init__.py +0 -0
  23. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/models/base.py +0 -0
  24. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/models/entities.py +0 -0
  25. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/py.typed +0 -0
  26. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/queries/__init__.py +0 -0
  27. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/queries/models.py +0 -0
  28. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/queries/params.py +0 -0
  29. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/statements/__init__.py +0 -0
  30. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/statements/expressions.py +0 -0
  31. {industrial_model-0.1.0 → industrial_model-0.1.2}/industrial_model/utils.py +0 -0
  32. {industrial_model-0.1.0 → industrial_model-0.1.2}/scripts/build.sh +0 -0
  33. {industrial_model-0.1.0 → industrial_model-0.1.2}/scripts/format.sh +0 -0
  34. {industrial_model-0.1.0 → industrial_model-0.1.2}/scripts/lint.sh +0 -0
  35. {industrial_model-0.1.0 → industrial_model-0.1.2}/tests/__init__.py +0 -0
  36. {industrial_model-0.1.0 → industrial_model-0.1.2}/tests/cognite-sdk-config.yaml +0 -0
  37. {industrial_model-0.1.0 → industrial_model-0.1.2}/tests/hubs.py +0 -0
  38. {industrial_model-0.1.0 → industrial_model-0.1.2}/tests/tests_adapter.py +0 -0
  39. {industrial_model-0.1.0 → industrial_model-0.1.2}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: industrial-model
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Industrial Model ORM
5
5
  Author-email: Lucas Alves <lucasrosaalves@gmail.com>
6
6
  Classifier: Programming Language :: Python
@@ -22,7 +22,7 @@ def get_schema_properties(
22
22
  nested_separator: str = NESTED_SEP,
23
23
  prefix: str | None = None,
24
24
  ) -> list[str]:
25
- data = _get_type_properties(cls, defaultdict(lambda: 0)) or {}
25
+ data = _get_type_properties(cls) or {}
26
26
  keys = _flatten_dict_keys(data, None, nested_separator)
27
27
  if not prefix:
28
28
  return keys
@@ -31,15 +31,19 @@ def get_schema_properties(
31
31
 
32
32
 
33
33
  def _get_type_properties(
34
- cls: type[BaseModel], visited_count: defaultdict[type, int]
34
+ cls: type[BaseModel], visited_count: defaultdict[type, int] | None = None
35
35
  ) -> dict[str, Any] | None:
36
- if visited_count[cls] > 2:
37
- return None
38
- visited_count[cls] += visited_count[cls] + 1
36
+ if visited_count is not None:
37
+ if visited_count[cls] > 2:
38
+ return None
39
+ visited_count[cls] += 1
39
40
 
40
41
  hints = get_type_hints(cls)
41
42
  origins = {
42
- key: _get_field_type(type_hint, visited_count)
43
+ key: _get_field_type(
44
+ type_hint,
45
+ visited_count or defaultdict(lambda: 0),
46
+ )
43
47
  for key, type_hint in hints.items()
44
48
  }
45
49
 
@@ -118,4 +122,4 @@ def _flatten_dict_keys(
118
122
  [f"{full_key}{nested_separator}{item}" for item in value]
119
123
  )
120
124
 
121
- return list(paths)
125
+ return sorted(paths)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "industrial-model"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "Industrial Model ORM"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"