industrial-model 0.1.0__py3-none-any.whl → 0.1.2__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.
@@ -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
  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
@@ -8,7 +8,7 @@ industrial_model/cognite_adapters/filter_mapper.py,sha256=NqH-OW7_iKFY9POCG8W3Kj
8
8
  industrial_model/cognite_adapters/optimizer.py,sha256=msOXAU2nY2-7U0-AlST3_SWuLHnyQ9wNa5_BzMRQfdw,2166
9
9
  industrial_model/cognite_adapters/query_mapper.py,sha256=lYKRiIEmFiX7CQUnrOh5_-t1UkAMcT3dr9ORgErDXOY,6233
10
10
  industrial_model/cognite_adapters/query_result_mapper.py,sha256=jUreXqsaLnq7hp6T_JZQNRtL8TL8hoLSFvD4SkJ4TEE,7002
11
- industrial_model/cognite_adapters/schemas.py,sha256=5sR0HPBWx9o11p_EN2sZR58XHovsfeoMsKwFHJAHrFI,3352
11
+ industrial_model/cognite_adapters/schemas.py,sha256=EiRe0HK6thCzk0WYOPrAIRe8GkkG7_ykQsy7WVfT_Og,3430
12
12
  industrial_model/cognite_adapters/sort_mapper.py,sha256=RJUAYlZGXoYzK0PwX63cibRF_L-MUq9g2ZsC2EeNIF4,696
13
13
  industrial_model/cognite_adapters/utils.py,sha256=nBYHK8697L2yGEAcyKjQV9NEZQmWy_aSGq_iMl7gofM,907
14
14
  industrial_model/cognite_adapters/view_mapper.py,sha256=lnv64KezSQTAr6XdcExa8d92GU5Ll9K9HfMcQGzhX6k,488
@@ -23,6 +23,6 @@ industrial_model/queries/models.py,sha256=iiHQ7-cfg0nukEv5PoCx9QPF-w1gVSnoNbXBOK
23
23
  industrial_model/queries/params.py,sha256=ehgCoR5n6E-tkEuoymZ2lkLcSzMaBAx_HnyJ7sWpqz0,964
24
24
  industrial_model/statements/__init__.py,sha256=mqPIvfQ-XZ_IILwha7RbkdIKH_MRAdAvfrw80pCKU1c,1753
25
25
  industrial_model/statements/expressions.py,sha256=bsUnkFDGVHpOQ1RUtEbSPE1nfVkF0zC3m5-9JFkSqu8,4751
26
- industrial_model-0.1.0.dist-info/METADATA,sha256=jZmhsTJkulF0xz4IMktuaiizIgVOTriD2G7zimsmozw,763
27
- industrial_model-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
- industrial_model-0.1.0.dist-info/RECORD,,
26
+ industrial_model-0.1.2.dist-info/METADATA,sha256=ZoXlx7woaGqKYSku3ooMzGzVu9MXcaMe-nTR0MiA4zg,763
27
+ industrial_model-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
+ industrial_model-0.1.2.dist-info/RECORD,,