Skip to content

Commit

Permalink
CDM is now GA (in the API), update warnings (#1963)
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonvt authored Oct 7, 2024
1 parent 723bde9 commit afd53a8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cognite/client/data_classes/data_modeling/cdm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from cognite.client.utils._experimental import FeaturePreviewWarning

FeaturePreviewWarning("alpha", "alpha", "Core Data Model").warn()
FeaturePreviewWarning("General Availability", "alpha", "Core Data Model").warn()
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from cognite.client.utils._experimental import FeaturePreviewWarning

FeaturePreviewWarning("alpha", "alpha", "Extractor Extension Model").warn()
FeaturePreviewWarning("General Availability", "alpha", "Extractor Extension Model").warn()
8 changes: 6 additions & 2 deletions cognite/client/utils/_experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

class FeaturePreviewWarning(FutureWarning):
def __init__(
self, api_maturity: Literal["alpha", "beta"], sdk_maturity: Literal["alpha", "beta"], feature_name: str
self,
api_maturity: Literal["alpha", "beta", "General Availability"],
sdk_maturity: Literal["alpha", "beta"],
feature_name: str,
):
self.api_version = api_maturity
self.sdk_version = sdk_maturity
Expand All @@ -15,7 +18,8 @@ def __init__(
def __str__(self) -> str:
if self.api_version == "alpha" or self.sdk_version == "alpha":
return (
f"{self.feature_name} is in alpha and is subject to breaking changes without notice. API maturity={self.api_version}, SDK maturity={self.sdk_version}. "
f"{self.feature_name} is in alpha and is subject to breaking changes without prior notice. "
f"API maturity={self.api_version}, SDK maturity={self.sdk_version}. "
"See https://cognite-sdk-python.readthedocs-hosted.com/en/latest/appendix.html for more information."
)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_integration/test_api/test_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def group_list(cognite_client) -> GroupList:

class TestGroupsAPI:
def test_dump_load_group_list(self, group_list: GroupList) -> None:
loaded = GroupList.load(group_list.dump(camel_case=True))
loaded = GroupList._load(group_list.dump(camel_case=True), allow_unknown=True)
assert group_list.dump() == loaded.dump()

@pytest.mark.skip(
Expand Down

0 comments on commit afd53a8

Please sign in to comment.