Skip to content

Commit 03189e0

Browse files
streams and project namespaces
1 parent abc69dd commit 03189e0

File tree

9 files changed

+308
-12
lines changed

9 files changed

+308
-12
lines changed

elasticsearch/_async/client/project.py

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

18-
class C:
18+
19+
import typing as t
20+
21+
from elastic_transport import ObjectApiResponse
22+
23+
from ._base import NamespacedClient
24+
from .utils import (
25+
Stability,
26+
_rewrite_parameters,
27+
_stability_warning,
28+
)
29+
30+
31+
class ProjectClient(NamespacedClient):
1932

2033
@_rewrite_parameters()
2134
@_stability_warning(Stability.EXPERIMENTAL)

elasticsearch/_async/client/streams.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
class C:
18+
import typing as t
19+
20+
from elastic_transport import ObjectApiResponse, TextApiResponse
21+
22+
from ._base import NamespacedClient
23+
from .utils import (
24+
Stability,
25+
_rewrite_parameters,
26+
_stability_warning,
27+
)
28+
29+
30+
class StreamsClient(NamespacedClient):
1931

2032
@_rewrite_parameters()
2133
@_stability_warning(Stability.EXPERIMENTAL)

elasticsearch/_sync/client/project.py

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

18-
class C:
18+
19+
import typing as t
20+
21+
from elastic_transport import ObjectApiResponse
22+
23+
from ._base import NamespacedClient
24+
from .utils import (
25+
Stability,
26+
_rewrite_parameters,
27+
_stability_warning,
28+
)
29+
30+
31+
class ProjectClient(NamespacedClient):
1932

2033
@_rewrite_parameters()
2134
@_stability_warning(Stability.EXPERIMENTAL)

elasticsearch/_sync/client/streams.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
class C:
18+
import typing as t
19+
20+
from elastic_transport import ObjectApiResponse, TextApiResponse
21+
22+
from ._base import NamespacedClient
23+
from .utils import (
24+
Stability,
25+
_rewrite_parameters,
26+
_stability_warning,
27+
)
28+
29+
30+
class StreamsClient(NamespacedClient):
1931

2032
@_rewrite_parameters()
2133
@_stability_warning(Stability.EXPERIMENTAL)

elasticsearch/dsl/aggs.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,54 @@ def __init__(
653653
)
654654

655655

656+
class CartesianBounds(Agg[_R]):
657+
"""
658+
A metric aggregation that computes the spatial bounding box containing
659+
all values for a Point or Shape field.
660+
661+
:arg field: The field on which to run the aggregation.
662+
:arg missing: The value to apply to documents that do not have a
663+
value. By default, documents without a value are ignored.
664+
:arg script:
665+
"""
666+
667+
name = "cartesian_bounds"
668+
669+
def __init__(
670+
self,
671+
*,
672+
field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
673+
missing: Union[str, int, float, bool, "DefaultType"] = DEFAULT,
674+
script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
675+
**kwargs: Any,
676+
):
677+
super().__init__(field=field, missing=missing, script=script, **kwargs)
678+
679+
680+
class CartesianCentroid(Agg[_R]):
681+
"""
682+
A metric aggregation that computes the weighted centroid from all
683+
coordinate values for point and shape fields.
684+
685+
:arg field: The field on which to run the aggregation.
686+
:arg missing: The value to apply to documents that do not have a
687+
value. By default, documents without a value are ignored.
688+
:arg script:
689+
"""
690+
691+
name = "cartesian_centroid"
692+
693+
def __init__(
694+
self,
695+
*,
696+
field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
697+
missing: Union[str, int, float, bool, "DefaultType"] = DEFAULT,
698+
script: Union["types.Script", Dict[str, Any], "DefaultType"] = DEFAULT,
699+
**kwargs: Any,
700+
):
701+
super().__init__(field=field, missing=missing, script=script, **kwargs)
702+
703+
656704
class CategorizeText(Bucket[_R]):
657705
"""
658706
A multi-bucket aggregation that groups semi-structured text into
@@ -735,6 +783,43 @@ def __init__(
735783
)
736784

737785

786+
class ChangePoint(Pipeline[_R]):
787+
"""
788+
A sibling pipeline that detects, spikes, dips, and change points in a
789+
metric. Given a distribution of values provided by the sibling multi-
790+
bucket aggregation, this aggregation indicates the bucket of any spike
791+
or dip and/or the bucket at which the largest change in the
792+
distribution of values, if they are statistically significant. There
793+
must be at least 22 bucketed values. Fewer than 1,000 is preferred.
794+
795+
:arg format: `DecimalFormat` pattern for the output value. If
796+
specified, the formatted value is returned in the aggregation’s
797+
`value_as_string` property.
798+
:arg gap_policy: Policy to apply when gaps are found in the data.
799+
Defaults to `skip` if omitted.
800+
:arg buckets_path: Path to the buckets that contain one set of values
801+
to correlate.
802+
"""
803+
804+
name = "change_point"
805+
806+
def __init__(
807+
self,
808+
*,
809+
format: Union[str, "DefaultType"] = DEFAULT,
810+
gap_policy: Union[
811+
Literal["skip", "insert_zeros", "keep_values"], "DefaultType"
812+
] = DEFAULT,
813+
buckets_path: Union[
814+
str, Sequence[str], Mapping[str, str], "DefaultType"
815+
] = DEFAULT,
816+
**kwargs: Any,
817+
):
818+
super().__init__(
819+
format=format, gap_policy=gap_policy, buckets_path=buckets_path, **kwargs
820+
)
821+
822+
738823
class Children(Bucket[_R]):
739824
"""
740825
A single bucket aggregation that selects child documents that have the

elasticsearch/dsl/field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3892,7 +3892,7 @@ def __init__(
38923892
"types.SemanticTextIndexOptions", Dict[str, Any], "DefaultType"
38933893
] = DEFAULT,
38943894
chunking_settings: Union[
3895-
"types.ChunkingSettings", Dict[str, Any], "DefaultType"
3895+
"types.ChunkingSettings", None, Dict[str, Any], "DefaultType"
38963896
] = DEFAULT,
38973897
fields: Union[Mapping[str, Field], "DefaultType"] = DEFAULT,
38983898
**kwargs: Any,

elasticsearch/dsl/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ def __init__(
14331433
] = DEFAULT,
14341434
version: Union[int, "DefaultType"] = DEFAULT,
14351435
version_type: Union[
1436-
Literal["internal", "external", "external_gte", "force"], "DefaultType"
1436+
Literal["internal", "external", "external_gte"], "DefaultType"
14371437
] = DEFAULT,
14381438
boost: Union[float, "DefaultType"] = DEFAULT,
14391439
_name: Union[str, "DefaultType"] = DEFAULT,

elasticsearch/dsl/response/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,13 @@ def search_after(self) -> "SearchBase[_R]":
233233
"types.SimpleValueAggregate",
234234
"types.DerivativeAggregate",
235235
"types.BucketMetricValueAggregate",
236+
"types.ChangePointAggregate",
236237
"types.StatsAggregate",
237238
"types.StatsBucketAggregate",
238239
"types.ExtendedStatsAggregate",
239240
"types.ExtendedStatsBucketAggregate",
241+
"types.CartesianBoundsAggregate",
242+
"types.CartesianCentroidAggregate",
240243
"types.GeoBoundsAggregate",
241244
"types.GeoCentroidAggregate",
242245
"types.HistogramAggregate",

0 commit comments

Comments
 (0)