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

remove DSL code and redirect imports to unified Python client #1968

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ python:
- develop

sphinx:
configuration: docs/conf.py
fail_on_warning: true
7 changes: 7 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Elasticsearch DSL
=================

> [!NOTE]
> As of release 9.0, Elasticsearch DSL is part of the official Elasticsearch
> client for Python, so a separate install is not needed. To migrate, just
> replace `elasticsearch_dsl` with `elasticsearch.dsl` in all imports.
>
> The following instructions apply to versions 8 and older.

Elasticsearch DSL is a high-level library whose aim is to help with writing and
running queries against Elasticsearch. It is built on top of the official
low-level client (`elasticsearch-py <https://github.com/elastic/elasticsearch-py>`_).
Expand Down
198 changes: 10 additions & 188 deletions elasticsearch_dsl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,192 +15,14 @@
# specific language governing permissions and limitations
# under the License.

from . import async_connections, connections
from .aggs import A, Agg
from .analysis import analyzer, char_filter, normalizer, token_filter, tokenizer
from .document import AsyncDocument, Document
from .document_base import InnerDoc, M, MetaField, mapped_field
from .exceptions import (
ElasticsearchDslException,
IllegalOperation,
UnknownDslObject,
ValidationException,
)
from .faceted_search import (
AsyncFacetedSearch,
DateHistogramFacet,
Facet,
FacetedResponse,
FacetedSearch,
HistogramFacet,
NestedFacet,
RangeFacet,
TermsFacet,
)
from .field import (
Binary,
Boolean,
Byte,
Completion,
ConstantKeyword,
CustomField,
Date,
DateRange,
DenseVector,
Double,
DoubleRange,
Field,
Float,
FloatRange,
GeoPoint,
GeoShape,
HalfFloat,
Integer,
IntegerRange,
Ip,
IpRange,
Join,
Keyword,
Long,
LongRange,
Murmur3,
Nested,
Object,
Percolator,
Point,
RangeField,
RankFeature,
RankFeatures,
ScaledFloat,
SearchAsYouType,
Shape,
Short,
SparseVector,
Text,
TokenCount,
construct_field,
)
from .function import SF
from .index import (
AsyncComposableIndexTemplate,
AsyncIndex,
AsyncIndexTemplate,
ComposableIndexTemplate,
Index,
IndexTemplate,
)
from .mapping import AsyncMapping, Mapping
from .query import Q, Query
from .response import AggResponse, Response, UpdateByQueryResponse
from .search import (
AsyncEmptySearch,
AsyncMultiSearch,
AsyncSearch,
EmptySearch,
MultiSearch,
Search,
)
from .update_by_query import AsyncUpdateByQuery, UpdateByQuery
from .utils import AttrDict, AttrList, DslBase
from .wrappers import Range
import sys

VERSION = (8, 17, 1)
__version__ = VERSION
__versionstr__ = ".".join(map(str, VERSION))
__all__ = [
"A",
"Agg",
"AggResponse",
"AsyncComposableIndexTemplate",
"AsyncDocument",
"AsyncEmptySearch",
"AsyncFacetedSearch",
"AsyncIndex",
"AsyncIndexTemplate",
"AsyncMapping",
"AsyncMultiSearch",
"AsyncSearch",
"AsyncUpdateByQuery",
"AttrDict",
"AttrList",
"Binary",
"Boolean",
"Byte",
"Completion",
"ComposableIndexTemplate",
"ConstantKeyword",
"CustomField",
"Date",
"DateHistogramFacet",
"DateRange",
"DenseVector",
"Document",
"Double",
"DoubleRange",
"DslBase",
"ElasticsearchDslException",
"EmptySearch",
"Facet",
"FacetedResponse",
"FacetedSearch",
"Field",
"Float",
"FloatRange",
"GeoPoint",
"GeoShape",
"HalfFloat",
"HistogramFacet",
"IllegalOperation",
"Index",
"IndexTemplate",
"InnerDoc",
"Integer",
"IntegerRange",
"Ip",
"IpRange",
"Join",
"Keyword",
"Long",
"LongRange",
"M",
"Mapping",
"MetaField",
"MultiSearch",
"Murmur3",
"Nested",
"NestedFacet",
"Object",
"Percolator",
"Point",
"Q",
"Query",
"Range",
"RangeFacet",
"RangeField",
"RankFeature",
"RankFeatures",
"Response",
"SF",
"ScaledFloat",
"Search",
"SearchAsYouType",
"Shape",
"Short",
"SparseVector",
"TermsFacet",
"Text",
"TokenCount",
"UnknownDslObject",
"UpdateByQuery",
"UpdateByQueryResponse",
"ValidationException",
"analyzer",
"async_connections",
"char_filter",
"connections",
"construct_field",
"mapped_field",
"normalizer",
"token_filter",
"tokenizer",
]
from elasticsearch import __version__, dsl # noqa: F401

modules = [mod for mod in sys.modules.keys() if mod.startswith("elasticsearch.dsl")]
for mod in modules:
sys.modules[mod.replace("elasticsearch.dsl", "elasticsearch_dsl")] = sys.modules[
mod
]
sys.modules["elasticsearch_dsl"].VERSION = __version__
sys.modules["elasticsearch_dsl"].__versionstr__ = ".".join(map(str, __version__))
16 changes: 0 additions & 16 deletions elasticsearch_dsl/_async/__init__.py

This file was deleted.

Loading