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

[PR] Changes to support string transform in add_field. [iceberg-python]

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

   Closes #1882
   
   # Rationale for this change
   Feature request: Ability to pass transform name as string in `add_fields`
   
   # Are these changes tested?
   Yes
   
   # Are there any user-facing changes?
   Yes. Users will be able to pass transform names as string while calling add_fields method of update_spec.
   
   


-- 
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: [PR] Changes to support string transform in add_field. [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu merged PR #1936:
URL: https://github.com/apache/iceberg-python/pull/1936


-- 
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: [PR] Changes to support string transform in add_field. [iceberg-python]

Posted by "guptaakashdeep (via GitHub)" <gi...@apache.org>.
guptaakashdeep commented on code in PR #1936:
URL: https://github.com/apache/iceberg-python/pull/1936#discussion_r2051557551


##########
pyiceberg/transforms.py:
##########
@@ -111,29 +111,6 @@ def _transform_literal(func: Callable[[L], L], lit: Literal[L]) -> Literal[L]:
     return literal(func(lit.value))
 
 
-def parse_transform(v: Any) -> Any:

Review Comment:
   @kevinjqliu  yes this is intentional.
   
   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]` in `add_field`. Without moving it down, Transform wasn't being recognized in the code.



-- 
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: [PR] Changes to support string transform in add_field. [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #1936:
URL: https://github.com/apache/iceberg-python/pull/1936#discussion_r2051547823


##########
pyiceberg/transforms.py:
##########
@@ -111,29 +111,6 @@ def _transform_literal(func: Callable[[L], L], lit: Literal[L]) -> Literal[L]:
     return literal(func(lit.value))
 
 
-def parse_transform(v: Any) -> Any:

Review Comment:
   is this intentional? seems like the function got moved lower



-- 
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: [PR] Changes to support string transform in add_field. [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on PR #1936:
URL: https://github.com/apache/iceberg-python/pull/1936#issuecomment-2816829704

   Thanks @guptaakashdeep 


-- 
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: [PR] Changes to support string transform in add_field. [iceberg-python]

Posted by "guptaakashdeep (via GitHub)" <gi...@apache.org>.
guptaakashdeep commented on PR #1936:
URL: https://github.com/apache/iceberg-python/pull/1936#issuecomment-2816695982

   @Fokko Requesting review whenever you can. More details on changes I added in #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