Passing objective "multi:softmax" to SparkXGBClassifier

I want to pass objective=“multi:softmax” for a multiclass classification problem to SparkXGBClassifier, however this is only allowed if I specify it in a dictionary(e.g xgb_params) and create ‘xgb_clf = SparkXGBClassifier(params=xgb_params’.

Otherwise I get an error that I am not allowed to pass custom objective, e.g if I set it directly in the constructor. Why is this?