Skip to content

Conversation

@vbarua
Copy link
Member

@vbarua vbarua commented Jan 14, 2026

Generated code is packaged and available in the substrait-protobuf package

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2026

CLA assistant check
All committers have signed the CLA.

@vbarua vbarua changed the title feat: remove generated protobuf code from substrait-python [DO NOT MERGE] feat: remove generated protobuf code from substrait-python Jan 14, 2026
@github-actions
Copy link

ACTION NEEDED

Substrait follows the Conventional Commits
specification
for
release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved all of the extension files to a different dedicated directory, to avoid a conflict with the substrait.extensions module which is where the extension.proto code gets generated into.

from substrait.parameterized_types_pb2 import *
from substrait.plan_pb2 import *
from substrait.type_expressions_pb2 import *
from substrait.type_pb2 import *
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not clever enough to recreate whatever was happening in proto.py, but I am smart enough to re-export it all by hand. It's not as flashy, but it does the job.

Copy link
Contributor

Choose a reason for hiding this comment

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

tbh, pretty sure that module was there to avoid writing out gen.proto in imports (which I was doing anyway 😆) if protos are moved to top-level substrait namespace, I don't think we need to keep this around.

@@ -0,0 +1,3 @@
from importlib.metadata import version

substrait_version = version("vbarua-substrait-protobuf")
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of baking in the substrait version into substrait-python, we can just use the version of substrait-protobuf which should correspond to a spec version.


__substrait_version__ = "0.79.0"
__substrait_hash__ = "92d2e75"
__minimum_substrait_version__ = "0.30.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

Of these 3 versions, the only thing I've preserved is substrait_version which can be found in version.py now.

substrait_hash is optional, and we don't need to be setting it or making it available if we're making the substrait_version available.

I'm not sure what __minimum_substrait_version__ is for, but it hasn't been update in over 2 years.

Copy link
Contributor

Choose a reason for hiding this comment

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

this made me think if we might have a problem if someone inadvertently installs different versions of substrait-protobuf and substrait-antlr for example... do you think substrait_version should refer exclusively to protobuf? or maybe we need some sort of an eager check to make sure all those substrait package versions line up

@vbarua
Copy link
Member Author

vbarua commented Jan 14, 2026

This looks like a lot of changes, but the vast majority of changes are just import path updates of

substrait.gen.proto

to

substrait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants