Hi everyone, I’m trying to work with datasketches in Python. I’m having a bit 
of trouble understanding the interface for TupleSketch. I creating a custom 
policy which updates a counter, and created an update_tuple_sketch like so:

```
from _datasketches import TuplePolicy
import datasketches

class MyCounterPolicy(TuplePolicy):
    def __init__(self):
        TuplePolicy.__init__(self)

    def create_summary(self) -> int:
        return int(1)

    def update_summary(self, summary: int, update: int) -> int:
        print(summary, update)
        summary += update
        return summary

    def __call__(self, summary: int, update: int) -> int:
        summary += update
        return summary

sketch = datasketches.update_tuple_sketch(MyCounterPolicy(), lg_k=12)
sketch.update(1, 2)
```

The print() statement in update_summary confirms that it is called with the 
appropriate arguments. So, once I’ve called sketch.update, how do I access the 
summary information, which should be a single in equal to 3?

Reply via email to