Skip to content
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 docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This minor version includes:
- Backwards compatibility:
- Every ``_``-prefixed spelling is still importable from the module that defines it, and is the same object as its public counterpart, so ``isinstance`` checks and existing imports of it are unaffected
- A private spelling that was only ever reachable through a module that happened to import it — the executor modules, and a few of the ``config_*`` modules — is no longer reachable there. Import configuration types from ``weaviate.classes.config``, or from ``weaviate.collections.classes.config``
- Deprecate ``client.graphql_raw_query()``, which will be removed in a release after May 1, 2027, when Weaviate retires the GraphQL API. Use the collection query methods or the REST Search API instead

Version 4.23.1
--------------
Expand Down
4 changes: 4 additions & 0 deletions weaviate/client_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from .types import NUMBER
from .util import _decode_json_response_dict
from .validator import _validate_input, _ValidateArgument
from .warnings import _Warnings

TIMEOUT_TYPE = Union[Tuple[NUMBER, NUMBER], NUMBER]

Expand Down Expand Up @@ -227,6 +228,8 @@ def exc(e: Exception) -> bool:
def graphql_raw_query(self, gql_query: str) -> executor.Result[_RawGQLReturn]:
"""Allows to send graphQL string queries, this should only be used for weaviate-features that are not yet supported.

Deprecated: use the collection query methods or the REST Search API instead. This method will be removed in a release after May 1, 2027 when we retire GraphQL support.

Be cautious of injection risks when generating query strings.

Args:
Expand All @@ -240,6 +243,7 @@ def graphql_raw_query(self, gql_query: str) -> executor.Result[_RawGQLReturn]:
weaviate.exceptions.WeaviateConnectionError: If the network connection to weaviate fails.
weaviate.exceptions.UnexpectedStatusCodeError: If weaviate reports a none OK status.
"""
_Warnings.graphql_raw_query_deprecated()
_validate_input(_ValidateArgument([str], "gql_query", gql_query))
json_query = {"query": gql_query}

Expand Down
10 changes: 10 additions & 0 deletions weaviate/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ def async_enabled_field_removed_server_side() -> None:
stacklevel=1,
)

@staticmethod
def graphql_raw_query_deprecated() -> None:
warnings.warn(
message="""Dep031: graphql_raw_query() is deprecated and will be removed from the client in a release after May 1, 2027, when Weaviate retires the GraphQL API.
Use the collection query methods or the REST Search API instead.
See https://docs.weaviate.io/weaviate/api/graphql/migration for how to migrate.""",
category=DeprecationWarning,
stacklevel=1,
)

@staticmethod
def datetime_insertion_with_no_specified_timezone(date: datetime) -> None:
warnings.warn(
Expand Down
Loading