Skip to content

Commit c50b54a

Browse files
authored
[7.x] Add isort, rename nox session blacken->format
1 parent 8bfbdfb commit c50b54a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+310
-170
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ matrix:
2424
- python -m pip install nox
2525
script:
2626
- nox -s lint
27+
allow_failures:
28+
- python: "nightly"
2729

2830
install:
2931
- mkdir /tmp/elasticsearch

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
# All configuration values have a default; values that are commented out
2929
# serve to show the default.
3030

31-
import os
3231
import datetime
32+
import os
33+
3334
import elasticsearch_dsl
3435

3536
# If extensions (or modules to document with autodoc) are in another directory,

elasticsearch_dsl/__init__.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,25 @@
1616
# under the License.
1717

1818
from . import connections
19-
from .query import Q
2019
from .aggs import A
21-
from .function import SF
22-
from .search import Search, MultiSearch
23-
from .update_by_query import UpdateByQuery
20+
from .analysis import analyzer, char_filter, normalizer, token_filter, tokenizer
21+
from .document import Document, InnerDoc, MetaField
22+
from .exceptions import (
23+
ElasticsearchDslException,
24+
IllegalOperation,
25+
UnknownDslObject,
26+
ValidationException,
27+
)
28+
from .faceted_search import (
29+
DateHistogramFacet,
30+
Facet,
31+
FacetedResponse,
32+
FacetedSearch,
33+
HistogramFacet,
34+
NestedFacet,
35+
RangeFacet,
36+
TermsFacet,
37+
)
2438
from .field import (
2539
Binary,
2640
Boolean,
@@ -60,28 +74,14 @@
6074
TokenCount,
6175
construct_field,
6276
)
63-
from .document import Document, MetaField, InnerDoc
64-
from .exceptions import (
65-
ElasticsearchDslException,
66-
IllegalOperation,
67-
UnknownDslObject,
68-
ValidationException,
69-
)
70-
from .mapping import Mapping
77+
from .function import SF
7178
from .index import Index, IndexTemplate
72-
from .analysis import analyzer, char_filter, normalizer, token_filter, tokenizer
73-
from .faceted_search import (
74-
DateHistogramFacet,
75-
Facet,
76-
FacetedResponse,
77-
FacetedSearch,
78-
HistogramFacet,
79-
NestedFacet,
80-
RangeFacet,
81-
TermsFacet,
82-
)
83-
from .wrappers import Range
79+
from .mapping import Mapping
80+
from .query import Q
81+
from .search import MultiSearch, Search
82+
from .update_by_query import UpdateByQuery
8483
from .utils import AttrDict, AttrList, DslBase
84+
from .wrappers import Range
8585

8686
VERSION = (7, 3, 0)
8787
__version__ = VERSION

elasticsearch_dsl/aggs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
except ImportError:
2121
import collections as collections_abc
2222

23+
from .response.aggs import AggResponse, BucketData, FieldBucketData, TopHitsData
2324
from .utils import DslBase
24-
from .response.aggs import BucketData, FieldBucketData, AggResponse, TopHitsData
2525

2626

2727
def A(name_or_agg, filter=None, **params):

elasticsearch_dsl/connections.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from six import string_types
19-
2018
from elasticsearch import Elasticsearch
19+
from six import string_types
2120

2221
from .serializer import serializer
2322

elasticsearch_dsl/faceted_search.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from datetime import timedelta, datetime
18+
from datetime import datetime, timedelta
19+
1920
from six import iteritems, itervalues
2021

21-
from .search import Search
2222
from .aggs import A
23-
from .utils import AttrDict
23+
from .query import MatchAll, Nested, Range, Terms
2424
from .response import Response
25-
from .query import Terms, Nested, Range, MatchAll
25+
from .search import Search
26+
from .utils import AttrDict
2627

2728
__all__ = [
2829
"FacetedSearch",

elasticsearch_dsl/field.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
from datetime import date, datetime
2828

2929
from dateutil import parser, tz
30-
from six import string_types, iteritems, integer_types
30+
from six import integer_types, iteritems, string_types
3131
from six.moves import map
3232

33-
from .query import Q
34-
from .utils import DslBase, AttrDict, AttrList
3533
from .exceptions import ValidationException
34+
from .query import Q
35+
from .utils import AttrDict, AttrList, DslBase
3636
from .wrappers import Range
3737

3838
unicode = type(u"")

elasticsearch_dsl/query.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222

2323
from itertools import chain
2424

25-
from .utils import DslBase
26-
from .function import ScoreFunction
27-
2825
# 'SF' looks unused but the test suite assumes it's available
2926
# from this module so others are liable to do so as well.
3027
from .function import SF # noqa: F401
28+
from .function import ScoreFunction
29+
from .utils import DslBase
3130

3231

3332
def Q(name_or_query="match_all", **params):

elasticsearch_dsl/response/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717

1818
from ..utils import AttrDict, AttrList, _wrap
19-
2019
from .hit import Hit, HitMeta
2120

2221
__all__ = ["Response", "AggResponse", "UpdateByQueryResponse", "Hit", "HitMeta"]

elasticsearch_dsl/response/aggs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
from ..utils import AttrDict, AttrList
19-
from . import Response, AggResponse
19+
from . import AggResponse, Response
2020

2121

2222
class Bucket(AggResponse):

0 commit comments

Comments
 (0)