Conversation
Clean up python client, implement arrow loading, skip testing table size in remove tests for now
texodus
left a comment
There was a problem hiding this comment.
Thanks for the PR! Looks great and is a super useful addition! There is a small bug I think with table names, but I will take care of fixing these in a cleanup PR.
|
|
||
| self.send(msg) | ||
|
|
||
| def table(self, data, index=None, limit=None, name=str(random())): |
There was a problem hiding this comment.
The default argument to name here is evaluated once when the method is created, so all proxy tables will have the same name.
There was a problem hiding this comment.
yup - that is a silly mistake on my part
| from .view_api import view as make_view | ||
|
|
||
|
|
||
| def table(client, data, index=None, limit=None, name=str(random())): |
There was a problem hiding this comment.
Same, and also it's probably a good idea to just make name a required arg here as this table is private to the library.
| def remove_port(self): | ||
| return self._async_queue("remove_port", "table_method") | ||
|
|
||
| def compute(self): |
There was a problem hiding this comment.
Unrelated - but I think we can deprecate this "feature flag" - its implementation returns true for JS and Python
| @@ -4,226 +4,4 @@ | |||
| # | |||
| # This file is part of the Perspective library, distributed under the terms of | |||
| # the Apache License 2.0. The full license can be found in the LICENSE file. | |||
| tbl = Table([{"a": "abc", "b": 123}], index="a") | ||
| tbl.remove(["abc"]) | ||
| assert tbl.view().to_records() == [] | ||
| # assert tbl.size() == 0 |
|
Also - I believe the FOSSA check is either malfunctioning or has recently received an update to its detection criteria. This PR specifically does not introduce dependencies, so if there are legitimate failures, they are pre-existing regardless. Thus, I'm going to override this check. |
This PR introduces
PerspectiveClient, which mimics the Javascript client implementation by offering a fully async (asynciooryield-based) API on top of the coreTableandViewpublic API. This is useful for testingperspective-pythonservers, as it offers programmatic access to Perspective's public API in Python.PerspectiveTornadoClientis an implementation of the client API that allows users to open up remoteTables andViews on aperspective-pythonserver, and treat them as if they were objects in the client runtime using eitherawaitoryield.The interface is extremely simple, using
asyncandawait:or
yield-based coroutines: