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

Method process

connection-examples/python/pg8000/state.py:37–47  ·  view source on GitHub ↗
(self, update: Update)

Source from the content-addressed store, hash-verified

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'])
39 count = self.state.get(value, 0) + update['diff']
40
41 if count <= 0:
42 del self.state[value]
43 else:
44 self.state[value] = count
45
46 if self.history is not None:
47 self.history.append(update)
48
49 def update(self, updates: List[Update], timestamp: int):
50 if len(updates) > 0:

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected