Skip to content
  • Bryan Cutler's avatar
    d8813fa0
    [SPARK-13625][PYSPARK][ML] Added a check to see if an attribute is a property... · d8813fa0
    Bryan Cutler authored
    [SPARK-13625][PYSPARK][ML] Added a check to see if an attribute is a property when getting param list
    
    ## What changes were proposed in this pull request?
    
    Added a check in pyspark.ml.param.Param.params() to see if an attribute is a property (decorated with `property`) before checking if it is a `Param` instance.  This prevents the property from being invoked to 'get' this attribute, which could possibly cause an error.
    
    ## How was this patch tested?
    
    Added a test case with a class has a property that will raise an error when invoked and then call`Param.params` to verify that the property is not invoked, but still able to find another property in the class.  Also ran pyspark-ml test before fix that will trigger an error, and again after the fix to verify that the error was resolved and the method was working properly.
    
    Author: Bryan Cutler <cutlerb@gmail.com>
    
    Closes #11476 from BryanCutler/pyspark-ml-property-attr-SPARK-13625.
    d8813fa0
    [SPARK-13625][PYSPARK][ML] Added a check to see if an attribute is a property...
    Bryan Cutler authored
    [SPARK-13625][PYSPARK][ML] Added a check to see if an attribute is a property when getting param list
    
    ## What changes were proposed in this pull request?
    
    Added a check in pyspark.ml.param.Param.params() to see if an attribute is a property (decorated with `property`) before checking if it is a `Param` instance.  This prevents the property from being invoked to 'get' this attribute, which could possibly cause an error.
    
    ## How was this patch tested?
    
    Added a test case with a class has a property that will raise an error when invoked and then call`Param.params` to verify that the property is not invoked, but still able to find another property in the class.  Also ran pyspark-ml test before fix that will trigger an error, and again after the fix to verify that the error was resolved and the method was working properly.
    
    Author: Bryan Cutler <cutlerb@gmail.com>
    
    Closes #11476 from BryanCutler/pyspark-ml-property-attr-SPARK-13625.
Loading