kevinjqliu commented on code in PR #1433:
URL: https://github.com/apache/iceberg-python/pull/1433#discussion_r1906457621
##########
mkdocs/docs/api.md:
##########
@@ -961,20 +963,21 @@ Renaming a field in an Iceberg table is simple:
```python
with table.update_schema() as update:
update.rename_column("retries", "num_retries")
- # This will rename `confirmed_by` to `exchange`
- update.rename_column("properties.confirmed_by", "exchange")
+ # This will rename `confirmed_by` to `processed_by` in the `details` struct
+ update.rename_column(("details", "confirmed_by"), ("detail",
"processed_by"))
Review Comment:
this example doesnt work
```
>>> with table.update_schema() as update:
... update.rename_column(("details", "confirmed_by"), ("detail",
"processed_by"))
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File
"/Users/kevinliu/repos/iceberg-python/pyiceberg/table/update/schema.py", line
278, in rename_column
self._updates[field_from.field_id] = NestedField(
^^^^^^^^^^^^
File "/Users/kevinliu/repos/iceberg-python/pyiceberg/types.py", line 333,
in __init__
super().__init__(**data)
File
"/Users/kevinliu/Library/Caches/pypoetry/virtualenvs/pyiceberg-Is5Rt7Ah-py3.12/lib/python3.12/site-packages/pydantic/main.py",
line 214, in __init__
validated_self = self.__pydantic_validator__.validate_python(data,
self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for
NestedField
name
Input should be a valid string [type=string_type, input_value=('detail',
'processed_by'), input_type=tuple]
For further information visit
https://errors.pydantic.dev/2.10/v/string_type
```
even though table has `details.confirmed_by`
```
>>> print(table.schema())
table {
1: city: optional string
2: lat: optional double
3: long: optional double
4: details: optional struct<5: confirmed_by: optional string (Name of the
exchange)>
}
```
--
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]