Pin serverless databricks-connect to MAJOR.MINOR, not bare major - #29
Merged
Conversation
A serverless environment's constraint list (protobuf, grpcio, pyarrow, etc.) is generated from a specific runtime snapshot, so it is only validated against the MAJOR.MINOR release series present at generation time. The previous bare-major pin (``~=18.0``, resolving ``>=18.0, <19``) allowed newer minor releases whose bundled pyspark protobuf stubs may be incompatible with the pinned runtime libraries. Concretely, ``databricks-connect~=18.0`` resolved to 18.3.4, whose pyspark pb2 files use a ``_globals`` pattern intended for protobuf 6.x's ``BuildTopDescriptorsAndMessages``. With the v5 constraint list's ``protobuf~=5.29.4`` (the runtime version), that method does not inject ``_globals``, so the ``if not _USE_C_DESCRIPTORS:`` branch raises ``NameError: name '_globals' is not defined``. Fix ``dbconnect_pin()`` to pin to MAJOR.MINOR.0 (``~=18.0.0``, resolving ``>=18.0.0, <18.1``) — matching what was generated for DBR environments all along — and regenerate the six serverless pyprojects. Co-authored-by: Isaac <no-reply@databricks.com>
rclarey
previously approved these changes
Aug 31, 2026
Update the expected value from ``~=17.0`` (the old bare-major pin) to ``~=17.3.0`` (MAJOR.MINOR.0) to match the corrected dbconnect_pin() and also fix the comment that still said ``~=MAJOR.0``. Co-authored-by: Isaac <no-reply@databricks.com>
rclarey
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dbconnect_pin()inenvgen.pywas producing bare-major pins (~=18.0) after PR Pin serverless databricks-connect by major (~=17.0, not ~=17.3.0) #15, allowing any version in the major series (e.g. 18.3.4).databricks-connect 18.3.4's bundled pyspark pb2 stubs use a_globalspattern requiring protobuf 6.x'sBuildTopDescriptorsAndMessages. With v5'sprotobuf~=5.29.4constraint, theif not _USE_C_DESCRIPTORS:branch raisesNameError: name '_globals' is not defined.MAJOR.MINOR.0(~=18.0.0→>=18.0.0, <18.1), matching how DBR environments have always been pinned, and regenerate all 6 serverless pyprojects.Test plan
uv syncon a default-python bundle resolves todatabricks-connect~=18.0.0(not 18.3.x)from databricks.connect import DatabricksSessionsucceeds after sync