Repository navigation
Glue catalog: use comment for table and namespace descriptions, like the Hive catalog - #4629
Open
prateek11rai wants to merge 2 commits into
Open
prateek11rai wants to merge 2 commits into
prateek11rai wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fokko
reviewed
Dec 5, 2026
Fokko
left a comment
Contributor
There was a problem hiding this comment.
Thanks @prateek11rai, nice one! Verified the parity with Java's GlueCatalog/IcebergToGlueConverter (GLUE_DESCRIPTION_KEY = "comment", description takes precedence over a comment parameter on load) and the behavior lines up, and the moto tests cover the legacy migration well. A few observations, none blocking:
pyiceberg/catalog/glue.py:1000:load_namespace_propertiesnow returns the description under bothcommentandDescription. A read-modify-write caller that edits onlyDescriptiongets silently overridden by the stalecommentalias, sincecommentwins inupdate_namespace_properties. Was that trade-off deliberate, or would returning onlycomment(like Java) be safer? You already raised it in the PR body; for what it's worth I'd lean towards the Java behavior.pyiceberg/catalog/glue.py:1027: withremovals={"comment"}andupdates={"Description": ...}combined, the update wins while thePropertiesUpdateSummarystill reportscommentas removed. Similarly, removing one alias clears both, but the summary only lists the key fromremovals. Probably fine, just worth being aware of.- Test coverage: no test that clears a table description again (removing
commenton a table commit), andtest_update_namespace_descriptionhas no case whereupdatessets both keys.
Nit: could you use @pytest.mark.parametrize instead of the loops in test_create_namespace_description_from_properties, test_update_namespace_description and test_create_table_description_from_properties?
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Note 🤖 Thanks @Fokko for the review! I've pushed 8d18b0a, which addresses all four points:
|
This branch has not been deployed
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.
Note
🤖
claude-opus-5-5on behalf of PrateekCloses #4628
Rationale for this change
The Glue catalog ignored a description set with
comment, unlike the Hive catalog, Java and iceberg-go (aa27f3f). The existing tests didn't catch it, and the docs didn't say which key to use. Details are in #4628. This PR fixes all three.Alignment. In the Glue catalog,
commentnow sets the Glue description of tables and namespaces, andDescriptionkeeps working as a legacy key. When both are set,commentwins, as in iceberg-go.TableInputin_construct_table_input, so the change is made once there. Rename is unchanged.commentas a parameter, still load it, and the next update moves it into the description.load_namespace_propertiesreturns the description under bothcommentandDescription, so existing readers ofDescriptiondon't break. iceberg-go returnscommentonly; we're happy to switch if you prefer._description_from_propertiesholds thecomment-first rule because it is needed in three places, like iceberg-go'sdescriptionProperty.Deprecating
Descriptionis left for the team to decide.Are these changes tested?
Yes, with moto in
tests/catalog/test_glue.py.test_create_namespace_with_comment_and_locationandtest_update_namespace_propertiesonly checked thatcommentround-trips through load. They now also assert the Glue description, and those assertions fail onmain. Two load tests now expect the extraDescriptionkey.commentalone,Descriptionalone, and both set, for tables and namespaces; updating and removing each key; and databases written by older versions.integration_test_glue.pyis updated to match. We didn't run it, because it needs a real AWS account and no CI workflow runs it.make lint,make testandmkdocs build --strictpass.Are there any user-facing changes?
Yes.
commenton a Glue table or namespace now sets its Glue description. Anything that only usesDescriptionbehaves as before.load_namespace_propertieson Glue also returnscomment.api.mdnow setscomment, with a sentence saying it is the table and namespace description.