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

Check for pointless statements #1039

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we enable the linter error for pointless statements and
fix all existing issues.

Relates #838

With this commit we enable the linter error for pointless statements and
fix all existing issues.

Relates elastic#838
@danielmitterdorfer danielmitterdorfer added enhancement Improves the status quo :misc Changes that don't affect users directly: linter fixes, test improvements, etc. labels Jul 28, 2020
@danielmitterdorfer danielmitterdorfer added this to the 2.0.1 milestone Jul 28, 2020
@danielmitterdorfer danielmitterdorfer self-assigned this Jul 28, 2020
Copy link
Contributor

@hub-cap hub-cap left a comment

Choose a reason for hiding this comment

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

LGTM, just one Q

"""
Return parsed comma separated host string as dict with "default" key.
This is needed to support backwards compatible --target-hosts for single clusters that are not
defined as a json string or file.
"""

from elasticsearch.client import _normalize_hosts
Copy link
Contributor

Choose a reason for hiding this comment

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

now im curious, why is this here and not at the top?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is related to initialization of loggers. We noticed that especially the elasticsearch dependency is problematic in that respect. A long time ago we had all imports at the top but the elasticsearch loggers were initialized when a module was loaded that imported elasticsearch which happened before Rally had a chance to configure logging properly. Therefore we never import any elasticsearch module at the top in Rally.

@danielmitterdorfer danielmitterdorfer merged commit 016d547 into elastic:master Aug 3, 2020
@danielmitterdorfer danielmitterdorfer deleted the lint-pointless-statement branch August 3, 2020 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the status quo :misc Changes that don't affect users directly: linter fixes, test improvements, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants