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

Use type name for data type check. #5364

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

trivialfis
Copy link
Member

I replaced explicit import for datatable with simple string. The trick should also work with other packages. But I'm keeping this PR to be minimum so that others can raise concerns around the new compatibility check.

Should close #5363 . @brydag Could you please try this patch? I can't reproduce it as there are some specific libraries in your dependencies that are using sys.__stdin__.

@RAMitchell Just tried importing dask + datatable, it seems they still don't play well with each others. But I don't think XGBoost is a good place to workaround the limitation.

@hcho3

* Avoid importing datatable.
* Fix dmlc#5363.
@trivialfis trivialfis changed the title Workaround blsssed Use type name for data type check. Feb 25, 2020
@brydag
Copy link

brydag commented Feb 25, 2020

Thank you very much it is work perfect. I spent so much time to google it. Thank you much.

@hcho3
Copy link
Collaborator

hcho3 commented Feb 25, 2020

Should we include this fix in 1.0.2?

@trivialfis
Copy link
Member Author

@hcho3 I would like to hear about your opinion. I want to merge it in 1.0.2 as I keep it small, but it will be great if you can help deciding about it as I sometimes can be over optimistic.

Copy link
Member

@RAMitchell RAMitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on the surface. How vulnerable are we if external libraries change the names or structure of imports? I guess we can just add possibilities as they occur.

@trivialfis
Copy link
Member Author

@RAMitchell That's a risk we need to take. For datatable the original code uses hasattr to dispatch so I assume it's a stable structure. On the bright side, we have tests for all packages we support.

@hcho3
Copy link
Collaborator

hcho3 commented Feb 26, 2020

I think it's small enough to be included in the patch release.

@trivialfis
Copy link
Member Author

I think it's small enough to be included in the patch release.

I will push into 1.0 release branch.

@trivialfis trivialfis merged commit a461a9a into dmlc:master Feb 26, 2020
@hcho3 hcho3 mentioned this pull request Feb 26, 2020
3 tasks
trivialfis added a commit to trivialfis/xgboost that referenced this pull request Feb 26, 2020
trivialfis added a commit that referenced this pull request Feb 26, 2020
@trivialfis trivialfis deleted the workaround-blsssed branch February 29, 2020 11:21
@hcho3
Copy link
Collaborator

hcho3 commented Mar 4, 2020

@brydag The 1.0.2 release is now available.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueError: underlying buffer has been detached
4 participants