apache / datasketches-cpp

Core C++ Sketch Library
https://datasketches.apache.org
Apache License 2.0
223 stars 71 forks source link

Frequent items generic support #343

Closed jmalkin closed 1 year ago

jmalkin commented 1 year ago

I'm very much torn on whether defining operator<< on py::object is a good idea, even with it static to limit the scope. The sketch's to_string() method won't work without that, though. Even this way, it requires there to be a __str__() method defined for the python class to work usefully.

Unless there's a better way the only alternatives are that we write a new to_string() for generic objects calling the method directly, write a version that can't list the objects, or remove that method entirely.

But this feels rather hacky so I'm open to suggestions.

jmalkin commented 1 year ago

Just realized I have no tests! That's a problem... But in the meantime, feel free to comment on whether this is even a viable approach.

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4148899339


Files with Coverage Reduction New Missed Lines %
theta/include/theta_sketch_impl.hpp 6 8.35%
theta/include/compact_theta_sketch_parser_impl.hpp 13 82.98%
<!-- Total: 19 -->
Totals Coverage Status
Change from base Build 4077312869: 3.3%
Covered Lines: 4927
Relevant Lines: 5072

💛 - Coveralls