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

Add implicit-reexport to mypy #343

Closed
wants to merge 1 commit into from
Closed

Conversation

V1NAY8
Copy link
Contributor

@V1NAY8 V1NAY8 commented Mar 7, 2021

This PR is to fix pipelines.

The following error was thrown:

00:55:26 eland/ml/transformers/__init__.py:67: error: Module 'eland.ml.transformers.xgboost' does not explicitly export attribute 'XGBClassifier'; implicit reexport disabled
00:55:26 eland/ml/transformers/__init__.py:67: error: Module 'eland.ml.transformers.xgboost' does not explicitly export attribute 'XGBRegressor'; implicit reexport disabled
00:55:26 eland/ml/transformers/__init__.py:88: error: Module 'eland.ml.transformers.lightgbm' does not explicitly export attribute 'LGBMClassifier'; implicit reexport disabled
00:55:26 eland/ml/transformers/__init__.py:88: error: Module 'eland.ml.transformers.lightgbm' does not explicitly export attribute 'LGBMRegressor'; implicit reexport disabled.

This is because these are implicit exports and mypy is not allowing them. My approach is to enable --implicit-reexports.

According to python/mypy#7042 (comment)

mypy should treat items in __all__ as exported. Not sure why this is happening.

@sethmlarson Any thoughts? Or Please review this and merge it into master.

@elasticmachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@sethmlarson
Copy link
Contributor

Hmm, is there a way we can fix the issue without the flag? I'd prefer to go that direction if possible. This may be as simple as using from .lightgbm import LGBMClassifier as LGBMClassifier for all re-exported imports within transformers/__init__.py.

@stevedodson
Copy link
Contributor

Hopefully resolved with eland/ml/transformers/init.py in #346

@sethmlarson
Copy link
Contributor

Closed in favor of #346

@V1NAY8 V1NAY8 deleted the fix-pipelines branch March 31, 2021 17:17
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.

4 participants