Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pyspark] fix a minor typing bug #9079

Merged
merged 1 commit into from
Apr 24, 2023
Merged

Conversation

wbo4958
Copy link
Contributor

@wbo4958 wbo4958 commented Apr 24, 2023

from xgboost.spark import SparkXGBClassifier will throw exception when running on older pyspark (3.2.1) with the error msg

---> 16     arbitrary_params_dict: Param[Dict] = Param(
     17         Params._dummy(),
     18         "arbitrary_params_dict",
     19         "arbitrary_params_dict This parameter holds all of the additional parameters which are "
     20         "not exposed as the the XGBoost Spark estimator params but can be recognized by "
     21         "underlying XGBoost library. It is stored as a dictionary.",
     22     )

TypeError: 'type' object is not subscriptable

Change the typing to "Param[Dict]"

`from xgboost.spark import SparkXGBClassifier` will throw exception
when running on older pyspark (3.2.1) with the error msg

``` python
---> 16     arbitrary_params_dict: Param[Dict] = Param(
     17         Params._dummy(),
     18         "arbitrary_params_dict",
     19         "arbitrary_params_dict This parameter holds all of the additional parameters which are "
     20         "not exposed as the the XGBoost Spark estimator params but can be recognized by "
     21         "underlying XGBoost library. It is stored as a dictionary.",
     22     )

TypeError: 'type' object is not subscriptable
```

Change the typing to "Param[Dict]"
@trivialfis trivialfis merged commit 339f21e into dmlc:master Apr 24, 2023
@wbo4958 wbo4958 deleted the pyspark-bug branch April 23, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants