MCPcopy Create free account
hub / github.com/MaterializeInc/demos / validate

Method validate

connection-examples/python/state.py:29–35  ·  view source on GitHub ↗
(self, timestamp: int)

Source from the content-addressed store, hash-verified

27 return self.history
28
29 def validate(self, timestamp: int):
30 if not self.valid:
31 raise Exception("Invalid state.")
32 elif timestamp < self.timestamp:
33 print("Invalid timestamp.")
34 self.valid = False
35 raise Exception(f"Update with timestamp ({timestamp}) is lower than the last timestamp ({self.timestamp}). Invalid state.")
36
37 def process(self, update: Update):
38 value = json.dumps(update['value'])

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected