Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perspective Virtual API (Python) #2625

Merged
merged 5 commits into from
Jul 4, 2024
Merged

Perspective Virtual API (Python) #2625

merged 5 commits into from
Jul 4, 2024

Conversation

texodus
Copy link
Member

@texodus texodus commented May 21, 2024

Python Library

Building on #2615, this PR updates the Python library bindings. This PR does not include:

Breaking API changes:

  • date and datetime are not supported by the Table constructor anymore. These are not valid JSON values and JSON parsing is now language-agnostic. A subsequent PR will add the ability to read JSON strings directly, where this can be overcome as Perspective 2.x did - add a handler for these types to the default json module dumps() function.
  • pandas.DataFrame is now handled by pyarrow, which needs to be installed for DataFrame type to work. Perspective implements no special inference/behavior for these, so it now inherits pyarrow's semantics regarding column types, precision, etc.

Rust Library

As a bonus which came together quite naturally, this PR also introduces a native Rust client and server for Perspective, which allows hosting the Perspective engine in e.g. axum, as well as the entirety of the Perspective API as previously implement for JavaScript and Python. The following new crates are introduced:

  • perspective (native) has been repurposed as the root native-Rust crate, re-exporting the Rust Client and Server APIs as well as conveniences for linking the two with other libraries like tokio.
  • perspective-python (native) contains the Python (pyO3) bindings, replacing the old C++ based perspective-python.
  • perspective-server (native) wraps the C++ engine for both perspective and perspective-python.

An axum server example has also been added to the examples/ directory.

@texodus texodus force-pushed the new-api-python-only branch 2 times, most recently from 0d29973 to 2390bc1 Compare May 21, 2024 07:26
@texodus texodus force-pushed the new-api-python-only branch 5 times, most recently from 9b4274e to 7d8d235 Compare May 27, 2024 23:42
@texodus texodus force-pushed the new-api-python-only branch from 7d8d235 to 807332b Compare June 3, 2024 17:52
@texodus texodus mentioned this pull request Jun 4, 2024
@texodus texodus force-pushed the new-api-python-only branch from 807332b to 69c8014 Compare June 12, 2024 16:56
@@ -16,7 +16,7 @@
"emscripten": "3.1.54",
"llvm": "17.0.6",
"engines": {
"node": ">=14.18.2 <22"
"node": ">=16"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem with this, just note that our build scripts don't work on node 22

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why? I run my local build on node 22.

@texodus texodus force-pushed the new-api-python-only branch 13 times, most recently from 893585f to f06783f Compare July 3, 2024 02:21
@texodus texodus force-pushed the new-api-python-only branch 14 times, most recently from 43d2e4f to 2a76951 Compare July 4, 2024 19:23
timbess and others added 4 commits July 4, 2024 18:28
Co-authored-by: Davis Silverman <sinistersnare@users.noreply.github.com>
Signed-off-by: Tim Bess <tim@prospective.dev>
Co-authored-by: Davis Silverman <sinistersnare@users.noreply.github.com>
Signed-off-by: Tim Bess <tim@prospective.dev>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Co-authored-by: Davis Silverman <sinistersnare@users.noreply.github.com>
Signed-off-by: Tim Bess <tim@prospective.dev>
@texodus texodus force-pushed the new-api-python-only branch from 2a76951 to b6f57b9 Compare July 4, 2024 22:32
Signed-off-by: Andrew Stein <steinlink@gmail.com>
@texodus texodus force-pushed the new-api-python-only branch from b6f57b9 to 99feef9 Compare July 4, 2024 22:38
@texodus texodus added enhancement Feature requests or improvements breaking labels Jul 4, 2024
@texodus texodus added this to the 3.0 milestone Jul 4, 2024
@texodus texodus marked this pull request as ready for review July 4, 2024 23:11
@texodus texodus merged commit 74fe1ab into master Jul 4, 2024
7 checks passed
@texodus texodus deleted the new-api-python-only branch July 4, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants