statikk 0.1.23__py3-none-any.whl → 0.1.24__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.
statikk/models.py CHANGED
@@ -61,6 +61,11 @@ class TreeStructureChange(BaseModel):
61
61
  timestamp: datetime = Field(default_factory=datetime.now)
62
62
 
63
63
 
64
+ class ChangeTrackerMixin:
65
+ def custom_hash(self) -> int:
66
+ return 0
67
+
68
+
64
69
  class TrackingMixin:
65
70
  _original_hash: int = Field(exclude=True)
66
71
 
@@ -137,12 +142,14 @@ class TrackingMixin:
137
142
  return tuple((self._make_hashable(k), self._make_hashable(v)) for k, v in sorted(value.items()))
138
143
  elif isinstance(value, BaseModel) and hasattr(value, "_recursive_hash"):
139
144
  return value._recursive_hash()
145
+ elif isinstance(value, ChangeTrackerMixin):
146
+ return value.custom_hash()
140
147
  else:
141
148
  try:
142
149
  return hash(value)
143
150
  except TypeError:
144
151
  logger.warning(
145
- f"{type(value)} is unhashable, tracking will not work. Consider implementing the TrackingMixin for this type."
152
+ f"{type(value)} is unhashable, tracking will be ignored for this item. Consider implementing the ChangeTrackerMixin for this type."
146
153
  )
147
154
  return None
148
155
  return value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: statikk
3
- Version: 0.1.23
3
+ Version: 0.1.24
4
4
  Summary: statikk is a single table application (STA) library for DynamoDb.
5
5
  Home-page: https://github.com/terinia/statikk
6
6
  Author: Balint Biro
@@ -3,10 +3,10 @@ statikk/conditions.py,sha256=63FYMR-UUaE-ZJEb_8CU721CQTwhajq39-BbokmKeMA,2166
3
3
  statikk/engine.py,sha256=zcoSR_exARya7_taiKd94lc0H8rQbNpdcOrKQmCrMKs,32106
4
4
  statikk/expressions.py,sha256=boAeGxZj2cDsXxoiX3IIEzfX9voSMQngi4-rE_jYeuE,12233
5
5
  statikk/fields.py,sha256=uLGD3xEnz2nqQY6EwG8Dd7pnRMMVP4PU2Z2I-uGNaTA,150
6
- statikk/models.py,sha256=IaB6USTvrzEQa3LewgFQ4772eaWkWFF_fyzIVQLzp8U,17385
6
+ statikk/models.py,sha256=CSg56yfjIS9agIEuTsFrDK86LTd93xSlWxeA4Fi60Zs,17576
7
7
  statikk/typing.py,sha256=laOlOpWOm9_sOj4hhdZnGTUZRiq8760_B9I9B3wBhz8,750
8
- statikk-0.1.23.dist-info/licenses/LICENSE.txt,sha256=uSH_2Hpb2Bigy5_HhBliN2fZbBU64G3ERM5zzhKPUEE,1078
9
- statikk-0.1.23.dist-info/METADATA,sha256=T31UUf0eGgl5onSnWNJ6yvRurfW9AAF8OrH-SA_U3G4,3183
10
- statikk-0.1.23.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
11
- statikk-0.1.23.dist-info/top_level.txt,sha256=etKmBbjzIlLpSefXoiOfhWGEgvqUEALaFwCjFDBD9YI,8
12
- statikk-0.1.23.dist-info/RECORD,,
8
+ statikk-0.1.24.dist-info/licenses/LICENSE.txt,sha256=uSH_2Hpb2Bigy5_HhBliN2fZbBU64G3ERM5zzhKPUEE,1078
9
+ statikk-0.1.24.dist-info/METADATA,sha256=5ezr_ZYUd6r1BJJ12HC7CP48wGuFz9uKBBEs4De4qxY,3183
10
+ statikk-0.1.24.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
11
+ statikk-0.1.24.dist-info/top_level.txt,sha256=etKmBbjzIlLpSefXoiOfhWGEgvqUEALaFwCjFDBD9YI,8
12
+ statikk-0.1.24.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.3)
2
+ Generator: setuptools (78.0.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5