prateek11rai opened a new pull request, #4629:
URL: https://github.com/apache/iceberg-python/pull/4629

   > [!NOTE]
   > 🤖 `claude-opus-5-5` on behalf of Prateek
   
   Closes #4628
   
   # Rationale for this change
   
   The Glue catalog ignored a description set with `comment`, unlike the Hive 
catalog, Java and iceberg-go 
([`aa27f3f`](https://github.com/apache/iceberg-go/commit/aa27f3fe9149d1e1bdff15cebd7c9242475507aa)).
 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, `comment` now sets the Glue description 
of tables and namespaces, and `Description` keeps working as a legacy key. When 
both are set, `comment` wins, as in iceberg-go.
   - **Tables:** every write path builds its `TableInput` in 
`_construct_table_input`, so the change is made once there. Rename is unchanged.
   - **Namespaces:** neither key is stored as a Glue parameter when it is used 
as the description. Setting either key updates the description, and removing 
either clears it. Databases written by older versions, which stored `comment` 
as a parameter, still load it, and the next update moves it into the 
description.
   - **Load:** `load_namespace_properties` returns the description under both 
`comment` and `Description`, so existing readers of `Description` don't break. 
iceberg-go returns `comment` only; we're happy to switch if you prefer.
   - **Helper:** `_description_from_properties` holds the `comment`-first rule 
because it is needed in three places, like iceberg-go's `descriptionProperty`.
   
   Deprecating `Description` is left for the team to decide.
   
   ## Are these changes tested?
   
   Yes, with moto in `tests/catalog/test_glue.py`.
   
   - **Existing tests:** `test_create_namespace_with_comment_and_location` and 
`test_update_namespace_properties` only checked that `comment` round-trips 
through load. They now also assert the Glue description, and those assertions 
fail on `main`. Two load tests now expect the extra `Description` key.
   - **New tests:** `comment` alone, `Description` alone, and both set, for 
tables and namespaces; updating and removing each key; and databases written by 
older versions.
   - **Integration tests:** `integration_test_glue.py` is updated to match. We 
didn't run it, because it needs a real AWS account and no CI workflow runs it.
   
   `make lint`, `make test` and `mkdocs build --strict` pass.
   
   ## Are there any user-facing changes?
   
   Yes.
   - A `comment` on a Glue table or namespace now sets its Glue description. 
Anything that only uses `Description` behaves as before.
   - `load_namespace_properties` on Glue also returns `comment`.
   - **Docs:**
     - The Glue section of the configuration docs gets a note with an example.
     - The "Create a table" example in `api.md` now sets `comment`, with a 
sentence saying it is the table and namespace description.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to