Skip to content

Commit

Permalink
show warning when using FDMs
Browse files Browse the repository at this point in the history
  • Loading branch information
silvavelosa committed Sep 27, 2022
1 parent 4760e9d commit d7211c4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cognite/client/data_classes/transformations/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from typing import Any, Dict, Optional

from cognite.client import utils
Expand Down Expand Up @@ -152,9 +153,22 @@ def __eq__(self, other: Any) -> bool:


class DataModelInstances(TransformationDestination):
_warning_shown = False

@classmethod
def _show_warning(cls) -> bool:
if not cls._warning_shown:
warnings.warn(
"Feature DataModeStorage is in beta and still in development. Breaking changes can happen in between patch versions."
)
cls._warning_shown = True
return True
return False

def __init__(
self, model_external_id: str = None, space_external_id: str = None, instance_space_external_id: str = None
):
DataModelInstances._show_warning()
super().__init__(type="data_model_instances")
self.model_external_id = model_external_id
self.space_external_id = space_external_id
Expand Down

0 comments on commit d7211c4

Please sign in to comment.