Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V8] remove deprecated load_yaml method #1964

Open
wants to merge 1 commit into
base: v8-release
Choose a base branch
from
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
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 @@ -150,14 +149,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 @@ -257,7 +257,7 @@ def query_with_non_yaml_native_data_classes() -> q.Query:
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)

def test_dump_yaml_no_tags(self, query_with_non_yaml_native_data_classes: q.Query) -> None:
Expand Down