From 5c8eceda0ba70637fcd8c1c6bb2c3398765f23ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20V=2E=20Treider?= Date: Mon, 7 Oct 2024 13:22:49 +0200 Subject: [PATCH] remove deprecated load_yaml method --- cognite/client/data_classes/data_modeling/query.py | 9 --------- .../test_data_classes/test_data_models/test_queries.py | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/cognite/client/data_classes/data_modeling/query.py b/cognite/client/data_classes/data_modeling/query.py index 28bf8c411c..2f2a7fba18 100644 --- a/cognite/client/data_classes/data_modeling/query.py +++ b/cognite/client/data_classes/data_modeling/query.py @@ -1,6 +1,5 @@ from __future__ import annotations -import warnings from abc import ABC, abstractmethod from collections import UserDict from collections.abc import Mapping, Sequence @@ -151,14 +150,6 @@ def dump(self, camel_case: bool = True) -> dict[str, Any]: output["cursors"] = dict(self.cursors.items()) return output - @classmethod - def load_yaml(cls, data: str) -> Query: - warnings.warn( - "Query.load_yaml is deprecated and will be removed after Oct 2024, please use Query.load", - UserWarning, - ) - return cls.load(data) - @classmethod def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self: parameters = dict(resource["parameters"].items()) if "parameters" in resource else None diff --git a/tests/tests_unit/test_data_classes/test_data_models/test_queries.py b/tests/tests_unit/test_data_classes/test_data_models/test_queries.py index 8d8bd6df6a..7c57da0c7a 100644 --- a/tests/tests_unit/test_data_classes/test_data_models/test_queries.py +++ b/tests/tests_unit/test_data_classes/test_data_models/test_queries.py @@ -234,5 +234,5 @@ def query_load_yaml_data() -> Iterator[ParameterSet]: class TestQuery: @pytest.mark.parametrize("raw_data, expected", list(query_load_yaml_data())) def test_load_yaml(self, raw_data: str, expected: q.Query) -> None: - actual = q.Query.load_yaml(raw_data) + actual = q.Query.load(raw_data) assert actual.dump(camel_case=True) == expected.dump(camel_case=True)