Skip to content

Commit

Permalink
remove deprecated load_yaml method
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonvt committed Oct 7, 2024
1 parent 16276b9 commit 5c8eced
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions cognite/client/data_classes/data_modeling/query.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 5c8eced

Please sign in to comment.