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

Drop support for Python 3.5, add Black #150

Merged
merged 10 commits into from
Mar 27, 2020

Conversation

sethmlarson
Copy link
Contributor

@sethmlarson sethmlarson commented Mar 25, 2020

Removes support for Python 3.5 and in the same branch adds Black+Flake8 and fixes all formatting issues. This PR is part of trying to get all Python clients on the same modern configuration for style and task management.

This PR consists of 4 commits, there are a lot of changes in the final commit so it's probably best to review each one individually:

  • Removed all mentions / code for maintaining 3.5: c91bdd8
  • Used pyupgrade to automatically do the upgrade from 3.5 -> 3.6: 9fbb21d
  • Added Nox as a task manager for testing and maintaining multiple Python versions: d603036
  • The results of running Black and fixing lint issues: d9ec28f

eland/_version.py Outdated Show resolved Hide resolved
@sethmlarson
Copy link
Contributor Author

sethmlarson commented Mar 25, 2020

Updated the certificates to the most recent recommended ones because they have proper subjectAltName entries for localhost, instance, etc. Now TLS can work both within and outside of the Docker container 🎉

@@ -10,7 +10,7 @@ fi
set -euxo pipefail


TEST_SUITE=${TEST_SUITE-oss}
TEST_SUITE=${TEST_SUITE-xpack}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to xpack by default because the test suite doesn't pass with oss due to ML.


return partial_result, df

def _flatten_dict(self, y, field_mapping_cache):
out = OrderedDict()
out = {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need to use OrderedDict anymore because all Python dicts are ordered, free performance boost. :)

Copy link
Contributor

@stevedodson stevedodson left a comment

Choose a reason for hiding this comment

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

Looks good! There are still some .format statements in the code we could change, but +1 for changes.

eland/arithmetics.py Outdated Show resolved Hide resolved
eland/common.py Outdated Show resolved Hide resolved
eland/dataframe.py Outdated Show resolved Hide resolved
eland/dataframe.py Show resolved Hide resolved
stevedodson added a commit that referenced this pull request Mar 26, 2020
* Updating test matrix for 7.6 + removing oss for now.

* Resolving 7.6.0 docs issues

* Updating ML docs

* Minor mod to support 6.x style indices.

Currently, there is no specific test for this as
it requires a 6.x cluster. 6.x is not officially
supported by 7.x clients, but this is a friendly
option for users.

* Adding unittest for FieldMappings._extract_fields_from_mapping

* Changing to f-string formatting and adding exception test

* Reverting to OrderedDict

Will change after #150 is merged.
@sethmlarson
Copy link
Contributor Author

All done with .format() to f-string, ready for a re-review if necessary.

Copy link
Contributor

@stevedodson stevedodson left a comment

Choose a reason for hiding this comment

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

LGTM!

@sethmlarson sethmlarson merged commit 0c1d722 into elastic:master Mar 27, 2020
@sethmlarson sethmlarson deleted the drop-py35 branch March 27, 2020 12:56
@stevedodson
Copy link
Contributor

LGTM!

RayDev1988 added a commit to RayDev1988/Python_Elastic- that referenced this pull request Mar 11, 2022
* Updating test matrix for 7.6 + removing oss for now.

* Resolving 7.6.0 docs issues

* Updating ML docs

* Minor mod to support 6.x style indices.

Currently, there is no specific test for this as
it requires a 6.x cluster. 6.x is not officially
supported by 7.x clients, but this is a friendly
option for users.

* Adding unittest for FieldMappings._extract_fields_from_mapping

* Changing to f-string formatting and adding exception test

* Reverting to OrderedDict

Will change after elastic/eland#150 is merged.
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.

3 participants