You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ueshin (via GitHub)" <gi...@apache.org> on 2024/07/26 00:06:03 UTC

[PR] [SPARK-49009][SQL][PYTHON] Make Column APIs and functions accept Enums [spark]

ueshin opened a new pull request, #47495:
URL: https://github.com/apache/spark/pull/47495

   ### What changes were proposed in this pull request?
   
   Make Column APIs and functions accept `Enum`s.
   
   ### Why are the changes needed?
   
   `Enum`s can be accepted in Column APIs and functions using its `value`.
   
   ```py
   >>> from pyspark.sql import functions as F
   >>> from enum import Enum
   >>> class A(Enum):
   ...   X = "x"
   ...   Y = "y"
   ...
   >>> F.lit(A.X)
   Column<'x'>
   >>> F.lit(A.X) + A.Y
   Column<'`+`(x, y)'>
   ```
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, Python's `Enum`s will be used as literal values.
   
   ### How was this patch tested?
   
   Added the related tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-49009][SQL][PYTHON] Make Column APIs and functions accept Enums [spark]

Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin commented on PR #47495:
URL: https://github.com/apache/spark/pull/47495#issuecomment-2253293999

   Thanks! merging to master.


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-49009][SQL][PYTHON] Make Column APIs and functions accept Enums [spark]

Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin commented on PR #47495:
URL: https://github.com/apache/spark/pull/47495#issuecomment-2253293672

   The failure seems not related to this PR. 


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-49009][SQL][PYTHON] Make Column APIs and functions accept Enums [spark]

Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin closed pull request #47495: [SPARK-49009][SQL][PYTHON] Make Column APIs and functions accept Enums
URL: https://github.com/apache/spark/pull/47495


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org