Skip to content

fix(python): cap substrait below 0.85.0#7153

Merged
AdamGS merged 1 commit intovortex-data:developfrom
RealXuChe:fix/substrait-upper-bound
Mar 25, 2026
Merged

fix(python): cap substrait below 0.85.0#7153
AdamGS merged 1 commit intovortex-data:developfrom
RealXuChe:fix/substrait-upper-bound

Conversation

@RealXuChe
Copy link
Copy Markdown
Contributor

Summary

Fixes #7152.

In Substrait 0.85.0, SimpleExtensionURI was removed. The Vortex Python bindings have not been updated to use the new implementation, and they also do not set an appropriate upper bound on the dependency version.

This change caps the Python dependency at substrait<0.85.0 until the code is updated for the URN schema.

This workaround is used because it is currently difficult to make Vortex support the latest Substrait. Vortex currently consumes Substrait expressions produced by PyArrow. However, the current Arrow tree still uses Substrait v0.44.0. Until Arrow is updated, it is difficult for us to support the latest Substrait easily because of our dependency on Arrow.

See:

PyArrow uses v0.44.0: https://github.com/apache/arrow/blob/f9315d4e7fb61ac85a77c651dcee84dbfad88472/cpp/thirdparty/versions.txt#L109

We convert PyArrow Expression into Substrait type:

def arrow_to_vortex(arrow_expression: pc.Expression, schema: pa.Schema) -> Expr:
compat_schema = _schema_for_substrait(schema)
substrait_object = ExtendedExpression()
substrait_object.ParseFromString(bytes(arrow_expression.to_substrait(compat_schema))) # pyright: ignore[reportUnusedCallResult]

Testing

Did not run tests. This is a dependency metadata change only.

Signed-off-by: Xu Che <chrisxuche@gmail.com>
@AdamGS AdamGS self-assigned this Mar 25, 2026
@AdamGS AdamGS added the changelog/fix A bug fix label Mar 25, 2026
@AdamGS AdamGS enabled auto-merge (squash) March 25, 2026 09:43
@AdamGS AdamGS merged commit 41b997d into vortex-data:develop Mar 25, 2026
59 of 60 checks passed
@RealXuChe
Copy link
Copy Markdown
Contributor Author

I found an important mistake in this PR, and I want to correct it here.

I was misled by the way the Substrait Python packaging is split. I also only did a quick check in an existing project before opening the PR, rather than testing the install in a clean environment from scratch. That rough testing caused me to miss the problem in this PR.

Most of my comments in the issue/PR are still correct:

  • The reported failure is real, caused exactly by the removal of SimpleExtensionURI
  • The removal was introduced in Substrait specification 0.85.0
  • PyArrow still uses an old Substrait schema, so we can't support the latest Substrait easily before PyArrow does.

However, I misunderstood how Substrait is packaged:

  • The Python package substrait does not come from the substrait spec repository. It comes from the separate Python binding repo
  • The Python package substrait has its own versioning and does not match the spec version
  • substrait-python v0.29.0 bumped Substrait specification to the 0.85.0 schema

(substrait-protobuf and substrait share the same substrait.* import namespace, really misleading!)

So this PR was wrong. I wrote the bound as if the PyPI substrait package version matched the spec version, which it does not. The version upper bound we should actually set is substrait<0.29.0.

I have now tested the new fix in a clean virtual environment, and I confirmed that this corrected bound works.

For this issue, I will send a follow-up PR to correct the dependency version bound.

AdamGS pushed a commit that referenced this pull request Mar 25, 2026
## Summary

I made a mistake in #7153, for details about the mistake, see this
comment:
#7153 (comment)

This PR correctly fixes the `substrait-python` dependency problem.

## Testing

- In a clean Python 3.12 virtual environment, `pip install
vortex-data==0.64.0` resolved to `substrait==0.29.0`,
`substrait-protobuf==0.85.0`, and `substrait-extensions==0.85.0`, and
`import vortex` failed.
- In a clean Python 3.12 virtual environment, installing `vortex-data`
from this PR branch resolved to `substrait==0.28.0`,
`substrait-protobuf==0.79.0`, and `substrait-extensions==0.79.0`, and
`import vortex` succeeded.

Signed-off-by: Xu Che <chrisxuche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incompatible with substrait v0.85.0+

2 participants