Skip to content

Commit ed79611

Browse files
authored
Merge branch 'master' into fix-propagate-is-false
2 parents 90c1928 + c4504c7 commit ed79611

File tree

18 files changed

+1337
-902
lines changed

18 files changed

+1337
-902
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
runs:
1414
using: 'composite'
1515
steps:
16-
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
16+
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
1717
with:
1818
python-version: ${{ inputs.python_version }}
1919
cache: 'pip'

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
lint:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
17+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1818
- uses: ./.github/actions/setup
1919
with:
2020
extras: "-E pandas"
@@ -24,23 +24,23 @@ jobs:
2424
build_docs:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
27+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2828
- uses: ./.github/actions/setup
2929
- name: Build docs
3030
run: cd docs && make html SPHINXOPTS="-W --keep-going"
3131

3232
build_package:
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
35+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
3636
- uses: ./.github/actions/setup
3737
- name: Build package
3838
run: poetry build
3939

4040
test_core:
4141
runs-on: ubuntu-latest
4242
steps:
43-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
43+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
4444
- uses: ./.github/actions/setup
4545
- name: Test core
4646
run: pytest tests/tests_unit -n8 --dist loadscope --maxfail 10 -m 'not dsl' --test-deps-only-core
@@ -53,7 +53,7 @@ jobs:
5353
os: [ubuntu-latest, windows-latest]
5454
python-version: ["3.10", "3.11", "3.12", "3.13"]
5555
steps:
56-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
56+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
5757
- uses: ./.github/actions/setup
5858
with:
5959
python_version: ${{ matrix.python-version }}

.github/workflows/cdf_auth.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
PROVIDER: "entra_id"
2525
LOGIN_FLOW: "client_credentials"
2626
steps:
27-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
27+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2828
- name: Build the CDF Groups
2929
working-directory: scripts/toolkit
3030
run: cdf build --env ${{ matrix.cdf_project }}

.github/workflows/manual-pre-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: windows-latest
1111
environment: CD
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1414

1515
- uses: ./.github/actions/setup
1616

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: windows-latest
1111
environment: CD
1212
steps:
13-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
13+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1414
- uses: ./.github/actions/setup
1515
with:
1616
extras: '-E all'

.github/workflows/verify-jupyter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
build_and_test_jupyter_pyodide:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
12+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1313
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
1414
with:
1515
python-version: '3.10'

.github/workflows/verify-streamlit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
build_and_test_streamlit_pyodide:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
12+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1313
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
1414
with:
1515
python-version: '3.10'

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "7.90.1"
2+
".": "7.91.0"
33
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ As of 2025-08-29, changes are grouped as follows
1313
- 🐛 Bug Fixes: Bug fixes.
1414
- ⚡ Improvements: Transparent changes, e.g. better performance.
1515

16+
## [7.91.0](https://github.com/cognitedata/cognite-sdk-python/compare/cognite-sdk-python-v7.90.1...cognite-sdk-python-v7.91.0) (2026-01-06)
17+
18+
19+
### Features
20+
21+
* **simint:** make `simulator_integration_external_id` optional on runs, routines and routine revisions ([#2420](https://github.com/cognitedata/cognite-sdk-python/issues/2420)) ([a18702b](https://github.com/cognitedata/cognite-sdk-python/commit/a18702b10e940bec9684589c86bd375a23613258))
22+
* **workflow-triggers:** add pause and resume functionality ([#2413](https://github.com/cognitedata/cognite-sdk-python/issues/2413)) ([1afc695](https://github.com/cognitedata/cognite-sdk-python/commit/1afc6951e26c9b1c59a63aca5a0b69fd19d6473e))
23+
24+
25+
### Bug Fixes
26+
27+
* add warning when operator is not passed to instances/search ([#2390](https://github.com/cognitedata/cognite-sdk-python/issues/2390)) ([8f8af02](https://github.com/cognitedata/cognite-sdk-python/commit/8f8af0283f61015f40723e91a1a7bc13b58e861a))
28+
1629
## [7.90.1](https://github.com/cognitedata/cognite-sdk-python/compare/cognite-sdk-python-v7.90.0...cognite-sdk-python-v7.90.1) (2025-11-27)
1730

1831

cognite/client/_api/data_modeling/instances.py

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import logging
66
import random
77
import time
8+
import warnings
89
from collections.abc import Callable, Iterable, Iterator, Sequence
910
from datetime import datetime, timezone
1011
from threading import Thread
@@ -1084,7 +1085,7 @@ def search(
10841085
include_typing: bool = False,
10851086
limit: int | None = DEFAULT_LIMIT_READ,
10861087
sort: Sequence[InstanceSort | dict] | InstanceSort | dict | None = None,
1087-
operator: Literal["AND", "OR"] = "OR",
1088+
operator: Literal["AND", "OR"] | None = None,
10881089
) -> NodeList[Node]: ...
10891090

10901091
@overload
@@ -1101,7 +1102,7 @@ def search(
11011102
include_typing: bool = False,
11021103
limit: int | None = DEFAULT_LIMIT_READ,
11031104
sort: Sequence[InstanceSort | dict] | InstanceSort | dict | None = None,
1104-
operator: Literal["AND", "OR"] = "OR",
1105+
operator: Literal["AND", "OR"] | None = None,
11051106
) -> EdgeList[Edge]: ...
11061107

11071108
@overload
@@ -1118,7 +1119,7 @@ def search(
11181119
include_typing: bool = False,
11191120
limit: int | None = DEFAULT_LIMIT_READ,
11201121
sort: Sequence[InstanceSort | dict] | InstanceSort | dict | None = None,
1121-
operator: Literal["AND", "OR"] = "OR",
1122+
operator: Literal["AND", "OR"] | None = None,
11221123
) -> NodeList[T_Node]: ...
11231124

11241125
@overload
@@ -1135,7 +1136,7 @@ def search(
11351136
include_typing: bool = False,
11361137
limit: int | None = DEFAULT_LIMIT_READ,
11371138
sort: Sequence[InstanceSort | dict] | InstanceSort | dict | None = None,
1138-
operator: Literal["AND", "OR"] = "OR",
1139+
operator: Literal["AND", "OR"] | None = None,
11391140
) -> EdgeList[T_Edge]: ...
11401141

11411142
def search(
@@ -1150,7 +1151,7 @@ def search(
11501151
include_typing: bool = False,
11511152
limit: int | None = DEFAULT_LIMIT_READ,
11521153
sort: Sequence[InstanceSort | dict] | InstanceSort | dict | None = None,
1153-
operator: Literal["AND", "OR"] = "OR",
1154+
operator: Literal["AND", "OR"] | None = None,
11541155
) -> NodeList[T_Node] | EdgeList[T_Edge]:
11551156
"""`Search instances <https://developer.cognite.com/api/v1/#tag/Instances/operation/searchInstances>`_
11561157
@@ -1166,34 +1167,43 @@ def search(
11661167
limit (int | None): Maximum number of instances to return. Defaults to 25. Will return the maximum number
11671168
of results (1000) if set to None, -1, or math.inf.
11681169
sort (Sequence[InstanceSort | dict] | InstanceSort | dict | None): How you want the listed instances information ordered.
1169-
operator (Literal['AND', 'OR']): Controls how multiple search terms are combined when matching documents. OR (default): A document matches if it contains any of the query terms in the searchable fields. This typically returns more results but with lower precision. AND: A document matches only if it contains all of the query terms across the searchable fields. This typically returns fewer results but with higher relevance.
1170+
operator (Literal['AND', 'OR'] | None): Controls how multiple search terms are combined when matching documents.
1171+
AND: A document matches only if it contains all of the query terms across the searchable fields. This typically
1172+
returns fewer results but with higher relevance. OR: A document matches if it contains any of the query terms in the searchable fields.
1173+
This typically returns more results but with lower precision. Note: If not specified, will default to the API default, which will change from
1174+
'OR' to 'AND' sometime in Q1 2027.
11701175
11711176
Returns:
11721177
NodeList[T_Node] | EdgeList[T_Edge]: Search result with matching nodes or edges.
11731178
11741179
Examples:
11751180
1176-
Search for Arnold in the person view in the name property:
1181+
Search for equipment containing both 'centrifugal' and 'pump' in the description:
11771182
11781183
>>> from cognite.client import CogniteClient
11791184
>>> from cognite.client.data_classes.data_modeling import ViewId
11801185
>>> client = CogniteClient()
1186+
>>> view = ViewId("assetSpace", "EquipmentView", "v1")
11811187
>>> res = client.data_modeling.instances.search(
1182-
... ViewId("mySpace", "PersonView", "v1"),
1183-
... query="Arnold",
1184-
... properties=["name"],
1188+
... view,
1189+
... query="centrifugal pump",
1190+
... properties=["description"],
1191+
... operator="AND"
11851192
... )
11861193
1187-
Search for Tarantino, Ritchie or Scorsese in the person view in the name property, but only born after 1942:
1194+
Search for 'pump', 'valve' or 'compressor', but filter on those installed after 2015:
11881195
11891196
>>> from cognite.client.data_classes.data_modeling import ViewId
11901197
>>> from cognite.client.data_classes import filters
1191-
>>> born_after_1942 = filters.Range(["mySpace", "PersonView/v1", "birthYear"], gt=1942)
1198+
>>> installed_after_2015 = filters.Range(
1199+
... ["assetSpace", "EquipmentView/v1", "installationYear"],
1200+
... gt=2015,
1201+
... )
11921202
>>> res = client.data_modeling.instances.search(
1193-
... ViewId("mySpace", "PersonView", "v1"),
1194-
... query="Tarantino Ritchie Scorsese",
1195-
... properties=["name"],
1196-
... filter=born_after_1942,
1203+
... view,
1204+
... query="pump valve compressor",
1205+
... properties=["name", "description"],
1206+
... filter=installed_after_2015,
11971207
... operator="OR"
11981208
... )
11991209
"""
@@ -1219,10 +1229,20 @@ def search(
12191229
"view": view.dump(camel_case=True),
12201230
"instanceType": instance_type_str,
12211231
"limit": self._SEARCH_LIMIT if is_unlimited(limit) else limit,
1222-
"operator": operator.upper(),
12231232
}
1224-
if body["operator"] not in ["AND", "OR"]:
1225-
raise ValueError(f"Invalid {operator=}. Must be 'AND' or 'OR'.")
1233+
if operator is None:
1234+
warnings.warn(
1235+
"The default operator for instance search will change from 'OR' to 'AND' sometime in Q1 2027. In the "
1236+
"next major version release (v8), the default will be changed to 'AND', which is the recommended "
1237+
"setting for most use cases. Please explicitly pass the operator to avoid this warning.",
1238+
UserWarning, # FutureWarning is more correct, but is ignored by default and we want users to see this
1239+
)
1240+
else:
1241+
op_up = operator.upper()
1242+
if op_up not in ("AND", "OR"):
1243+
raise ValueError(f"Invalid {operator=}. Must be 'AND' or 'OR'.")
1244+
body["operator"] = op_up
1245+
12261246
if query:
12271247
body["query"] = query
12281248
if properties:

0 commit comments

Comments
 (0)