You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Fokko (via GitHub)" <gi...@apache.org> on 2025/04/04 12:36:23 UTC

[I] Allow passing in a string transform for `tbl.update_spec().add_field()` [iceberg-python]

Fokko opened a new issue, #1882:
URL: https://github.com/apache/iceberg-python/issues/1882

   ### Feature Request / Improvement
   
   Today you have to pass in an instance of the transform:
   
   ```python
   with  tbl.update_spec() as upd:
       upd.add_field("tpep_pickup_datetime", DayTransform())
   ```
   
   Instead, I think it would be great to also pass in the [name](https://iceberg.apache.org/spec/#partition-transforms):
   
   ```
   with  tbl.update_spec() as upd:
       upd.add_field("tpep_pickup_datetime", "day")
   ```
   
   This should be pretty straightforward using the [`parse_transform` function](https://github.com/apache/iceberg-python/blob/5c4e59fca083d39dcd18305628a7e75674c0c1f6/pyiceberg/transforms.py#L114-L134).


-- 
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: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Allow passing in a string transform for `tbl.update_spec().add_field()` [iceberg-python]

Posted by "guptaakashdeep (via GitHub)" <gi...@apache.org>.
guptaakashdeep commented on issue #1882:
URL: https://github.com/apache/iceberg-python/issues/1882#issuecomment-2816694978

   @Fokko I have made changes to support this and has also added a test to test this for one of the transform passed as string name.
   
   I had to re-position the parse_transform method to change the return type of the method from `Any` to `Transform[Any, Any]` because `mypy` wasn't happy after we made Transform type as Union[str, Transform]
   
   Can you please review the changes once whenever you get chance?


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Allow passing in a string transform for `tbl.update_spec().add_field()` [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu closed issue #1882: Allow passing in a string transform for `tbl.update_spec().add_field()`
URL: https://github.com/apache/iceberg-python/issues/1882


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org