Skip to main content

Python bindings for validator

This directory contains a Rust/PyO3 project to generate Python bindings for the validator library.

Installation

The easiest way to install the validator is to get it from PyPI:

user@host:~$ pip install substrait-validator

If you want to build manually, running something along the lines of pip install . should work. You should only need to have a rust compiler installed.

If you want to create wheels or sdists of your own, you can do so using maturin (note the manual prepare_build.py invocation, see hints):

user@host:~$ pip install "maturin>=0.14,<0.15"
...
user@host:~$ ./prepare_build.py populate
user@host:~$ maturin build
...
📦 Built wheel for CPython 3.x to /path/to/substrait-validator/target/wheels/substrait_validator-x.y.z-cp3xx-cp3xx-linux_x86_64.whl
user@host:~$ maturin sdist
...
📦 Built source distribution to /path/to/substrait-validator/target/wheels/substrait_validator-x.y.z.tar.gz

Some hints if you run into issues:

  • This project relies on submodules, so you need to check those out first.
  • Out-of-tree builds are not supported, so you may need to beat pip into submission if you're using an old version or it otherwise insists on building from a temp directory.
  • If you get weird errors, try running ./prepare_build.py populate manually first. The protobuf generation logic has to be run very early in the build process, and while this is done automatically for most build methods, not all methods provide a hook for this.

Building wheels and source distributions

You can build wheels and source distributions using maturin, specifically using the build and sdist commands. However, before you can do this, you must run ./prepare_build.py populate. This makes local copies of some files in the repository that live outside of this subdirectory, such as the protobuf description files. When you use pip or some other tool based on pyproject.toml, this will be done automatically via build system hooks, but unfortunately maturin doesn't itself provide hooks with which this can be automated.

Running tests

You can test the module using pytest after you install it.

Command-line usage

The module exposes a command-line program named substrait-validator for running the validator manually. You can also use the tool to convert between various serialization formats of the substrait.Plan message. Run substrait-validator --help for more information.

Library usage

The library essentially provides a bunch of type conversion functions at module scope to convert between the various representations of a Substrait plan, including the result of the validator. The most important functions are arguably check_plan_valid(plan, config=None) and check_plan_not_invalid(plan, config=None), which run validation on the given plan and throw a Python exception corresponding to the first diagnostic returned by the validator of the highest severity encountered if the plan is not strictly or loosely valid respectively. That is, check_plan_valid will throw an exception if the plan could not be proven to be valid, while check_plan_not_invalid will only throw if it could be proven to be invalid.

The plan argument can be a number of things:

  • bytes: treated as a binary serialization of substrait.Plan.
  • str: treated as a protobuf JSON serialization of substrait.Plan.
  • dict: treated as the above using Python's data model (JSON objects map to dicts, JSON arrays map to lists).
  • substrait_validator.substrait.Plan: a previously deserialized plan.
  • substrait_validator.ResultHandle: a previously validated plan.

config can be None/unspecified, or can be set to a substrait_validator.Config object to configure the validator with.

For more information, use Python's help() function.

Metadata

Release files for substrait-validator 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for substrait-validator 0.1.4
File Size Uploaded
substrait_validator-0.1.4.tar.gz 462.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for substrait-validator 0.1.4
File
substrait_validator-0.1.4-cp312-none-win_amd64.whl CPython 3.12 none Windows x86-64 Details
substrait_validator-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
substrait_validator-0.1.4-cp312-cp312-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.12 CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.9+ x86-64 Details
substrait_validator-0.1.4-cp311-none-win_amd64.whl CPython 3.11 none Windows x86-64 Details
substrait_validator-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
substrait_validator-0.1.4-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64, macOS 10.9+ x86-64, macOS 10.9+ universal2 (ARM64, x86-64) Details
substrait_validator-0.1.4-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
substrait_validator-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
substrait_validator-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64, macOS 10.9+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details
substrait_validator-0.1.4-cp39-none-win_amd64.whl CPython 3.9 none Windows x86-64 Details
substrait_validator-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
substrait_validator-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64, macOS 10.9+ x86-64, macOS 10.9+ universal2 (ARM64, x86-64) Details
substrait_validator-0.1.4-cp38-none-win_amd64.whl CPython 3.8 none Windows x86-64 Details
substrait_validator-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
substrait_validator-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.8 CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.9+ x86-64 Details

Total release size: 61.2 MB

Release files / substrait_validator-0.1.4.tar.gz

Download URL substrait_validator-0.1.4.tar.gz
Size 462.8 kB
Tags Source
SHA-256 checksum
How to use checksums
928f2056fb0d9ad1a81d91ca4f2d1f619154ce768df3f295e1a845cda81b797f
BLAKE2b-256 checksum
How to use checksums
0dc9dad85fa1dd13a85d0d474b4c82da20990944a2f0563bbcaa868d7bf49846
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp312-none-win_amd64.whl

Download URL substrait_validator-0.1.4-cp312-none-win_amd64.whl
Size 2.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f686a51c747789c57b95042a5d53f0ef0a6616169a9e0b9b69161b5c1bb5c5d4
BLAKE2b-256 checksum
How to use checksums
b22ecf4587402541d7ce0926f3924ebd750eb6f7640a39a90d1ab4a5d52ce248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL substrait_validator-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.3 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e981e1c5239f17efea3c2726002e1f7a29b83e93a550660be2676d032f6c9c69
BLAKE2b-256 checksum
How to use checksums
e3ddfb992356942255a9816e11a364ec4242a5d6345539925e6c72297808398f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp312-cp312-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL substrait_validator-0.1.4-cp312-cp312-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 6.0 MB
Tags CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b71da3be6702d148e4a6ac538772617346971fe2e687a226e9da68dca45a29b3
BLAKE2b-256 checksum
How to use checksums
2030fb38e84ed8e1ea706be36c504e25cd8b47048a05ca933b466d21753fe452
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp311-none-win_amd64.whl

Download URL substrait_validator-0.1.4-cp311-none-win_amd64.whl
Size 2.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
1555e27417126513b54347b4fb0ae7971e6bdfe85725ff37e27577fe0f4fa1a0
BLAKE2b-256 checksum
How to use checksums
426d855daf8448ac56e77592308a50de6544b22417d7ff9e889df742cf7c23a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL substrait_validator-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.3 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e0e67e4eb3852dee47cef30a63339a2f64df57b1fa853aae94492f8895656f3a
BLAKE2b-256 checksum
How to use checksums
f99623b68e1596cd43a2b42a65b1b2944892e09100e3bba6785a423fcd1bad78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL substrait_validator-0.1.4-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 6.0 MB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ea4d0b620b1125c9d514de16a5cbc40133fa6c1084e00018823e8eebab2d29ee
BLAKE2b-256 checksum
How to use checksums
44fd68cca2167894f670fc3bac903762e36ca934acfd90cd73afa4aeaeb0a8eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp310-none-win_amd64.whl

Download URL substrait_validator-0.1.4-cp310-none-win_amd64.whl
Size 2.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
df84edbe9c1b26db5bfbf25fbc9b12e43e3f850f0cdfc5a852d6fc2a3d4ae774
BLAKE2b-256 checksum
How to use checksums
00f7e1afa9e4915d27a2d1c586f439dd17f0cab0fa80f53991c3fd26e2b2050e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL substrait_validator-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cc2d1eebd16c96d485f715d45c926bfccd8d3dec340191103dfcea6da8f44c93
BLAKE2b-256 checksum
How to use checksums
67de033f342fef66896193760aebdabb035557eca0b383fb6a0801229346307d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL substrait_validator-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 6.0 MB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f06daa8e7b71bf1e307465a602f13249400bba394799bc5e565b832f283ab816
BLAKE2b-256 checksum
How to use checksums
8cbc8ac89ef35d86e67b1622966772f8fd03c62a229261a813ef4416581a6e53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp39-none-win_amd64.whl

Download URL substrait_validator-0.1.4-cp39-none-win_amd64.whl
Size 2.8 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
20fceb72bc4779ec584a33025ccae24ef73aae0cfef86f640b425ddd8167d75d
BLAKE2b-256 checksum
How to use checksums
af5f68edf547d6b90d4ec6099f284a78b7ff53e283497f20b051eb8eead64922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL substrait_validator-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a4048a9d9de926ea9d0c011cdd672b168cf902a0fc85b79af1b27fc0c4a79404
BLAKE2b-256 checksum
How to use checksums
70a32e452df52e513932af46221d6b24ea1c1a4c63fdd653b15b23c85d3be790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL substrait_validator-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 5.9 MB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c6ed98cac87995d94a0e93122e9c157c19fd479ca792539f8fa96cddae168387
BLAKE2b-256 checksum
How to use checksums
cfcdeacb18042403e1d363d2968c1f2126f7a57e91770c6f26298503170344bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp38-none-win_amd64.whl

Download URL substrait_validator-0.1.4-cp38-none-win_amd64.whl
Size 2.8 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
49bf1aa8e781ab197ff9b3dda07fbe4d7e0e9310e349c82dd29aac9aeb943356
BLAKE2b-256 checksum
How to use checksums
94a6016d96b75bd0b123919408dc195b09fe2a920e3cc47559ed8b3b052f07da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL substrait_validator-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.3 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a349e532601e7f2657a960603800cfa5ea8a754f36f95417f2deafefebd79bfa
BLAKE2b-256 checksum
How to use checksums
31a951a854b66619aa1f03c64a424af1acb6269671cabda1265b3b97178b6221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release files / substrait_validator-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL substrait_validator-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 6.0 MB
Tags CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ca5cbb1112b478842b8e48e31b7700d296caba864857bf5d149da6f2fbfc41bb
BLAKE2b-256 checksum
How to use checksums
ff6f17f40eff277fc9dd3adeac060acea176fe1ef96de23a099d811548eaef60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.7

Release history Release notifications | RSS feed

This release

0.1.4 This release

16 release files

0.1.3

16 release files

0.0.9

16 release files

0.0.8

15 release files

0.0.7

15 release files

0.0.6

15 release files

0.0.5

15 release files

0.0.4

15 release files

0.0.3

15 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page