Skip to content
Snippets Groups Projects
  • ksonj's avatar
    757b2e91
    [SPARK-6553] [pyspark] Support functools.partial as UDF · 757b2e91
    ksonj authored
    
    Use `f.__repr__()` instead of `f.__name__` when instantiating `UserDefinedFunction`s, so `functools.partial`s may be used.
    
    Author: ksonj <kson@siberie.de>
    
    Closes #5206 from ksonj/partials and squashes the following commits:
    
    ea66f3d [ksonj] Inserted blank lines for PEP8 compliance
    d81b02b [ksonj] added tests for udf with partial function and callable object
    2c76100 [ksonj] Makes UDFs work with all types of callables
    b814a12 [ksonj] support functools.partial as udf
    
    (cherry picked from commit 98f72dfc)
    Signed-off-by: default avatarJosh Rosen <joshrosen@databricks.com>
    757b2e91
    History
    [SPARK-6553] [pyspark] Support functools.partial as UDF
    ksonj authored
    
    Use `f.__repr__()` instead of `f.__name__` when instantiating `UserDefinedFunction`s, so `functools.partial`s may be used.
    
    Author: ksonj <kson@siberie.de>
    
    Closes #5206 from ksonj/partials and squashes the following commits:
    
    ea66f3d [ksonj] Inserted blank lines for PEP8 compliance
    d81b02b [ksonj] added tests for udf with partial function and callable object
    2c76100 [ksonj] Makes UDFs work with all types of callables
    b814a12 [ksonj] support functools.partial as udf
    
    (cherry picked from commit 98f72dfc)
    Signed-off-by: default avatarJosh Rosen <joshrosen@databricks.com>
tests.py 25.94 KiB