-
Notifications
You must be signed in to change notification settings - Fork 27
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
Remove "beta" warning for Units catalog [POFSP-195] #1522
Merged
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b1844d0
Remove "beta" warning for Units catalog
polomani 4ab3ff3
Update units.py
polomani 1ef08d6
Update units.py
polomani 85f4d78
run linters
haakonvt 405928c
Remove alpha/beta warning
polomani fed64d4
Update units.py
polomani e712383
Merge branch 'master' into update-units-api-spec-ref
polomani a6a262d
Update the version number
polomani f81e9f9
Update CHANGELOG.md
polomani 2795e61
Remove redundant constructor
polomani 964bcaa
Merge branch 'master' into update-units-api-spec-ref
polomani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
UnitSystem, | ||
UnitSystemList, | ||
) | ||
from cognite.client.utils._experimental import FeaturePreviewWarning | ||
from cognite.client.utils._identifier import IdentifierSequence | ||
|
||
if TYPE_CHECKING: | ||
|
@@ -26,9 +25,7 @@ def __init__( | |
cognite_client: CogniteClient, | ||
) -> None: | ||
super().__init__(config, api_version, cognite_client) | ||
self._api_subversion = "beta" | ||
self._warning = FeaturePreviewWarning(api_maturity="beta", sdk_maturity="beta", feature_name="Unit Catalogue") | ||
self.systems = UnitSystemAPI(config, api_version, cognite_client, self._warning) | ||
self.systems = UnitSystemAPI(config, api_version, cognite_client) | ||
|
||
@overload | ||
def retrieve(self, external_id: str, ignore_unknown_ids: bool = False) -> None | Unit: | ||
|
@@ -41,7 +38,7 @@ def retrieve(self, external_id: MutableSequence[str], ignore_unknown_ids: bool = | |
def retrieve( | ||
self, external_id: str | MutableSequence[str], ignore_unknown_ids: bool = False | ||
) -> Unit | UnitList | None: | ||
"""`Retrieve one or more unit <https://pr-50.units-api.preview.cogniteapp.com/#tag/Units/operation/retrieve_units_by_ids_api_v1_projects__project__units_byids_post>`_ | ||
"""`Retrieve one or more unit <https://developer.cognite.com/api#tag/Units/operation/byIdsUnits>`_ | ||
|
||
Args: | ||
external_id (str | MutableSequence[str]): External ID or list of external IDs | ||
|
@@ -64,7 +61,6 @@ def retrieve( | |
>>> res = c.units.retrieve(['temperature:deg_c', 'pressure:bar']) | ||
|
||
""" | ||
self._warning.warn() | ||
identifier = IdentifierSequence.load(external_ids=external_id) | ||
return self._retrieve_multiple( | ||
identifiers=identifier, | ||
|
@@ -74,7 +70,7 @@ def retrieve( | |
) | ||
|
||
def list(self) -> UnitList: | ||
"""`List all supported units <https://pr-50.units-api.preview.cogniteapp.com/#tag/Units/operation/List_units_api_v1_projects__project__units_get>`_ | ||
"""`List all supported units <https://developer.cognite.com/api#tag/Units/operation/Units/listUnits>`_ | ||
|
||
Returns: | ||
UnitList: List of units | ||
|
@@ -86,7 +82,6 @@ def list(self) -> UnitList: | |
>>> c = CogniteClient() | ||
>>> res = c.units.list() | ||
""" | ||
self._warning.warn() | ||
return self._list(method="GET", list_cls=UnitList, resource_cls=Unit) | ||
|
||
|
||
|
@@ -98,14 +93,12 @@ def __init__( | |
config: ClientConfig, | ||
api_version: str | None, | ||
cognite_client: CogniteClient, | ||
warning: FeaturePreviewWarning, | ||
) -> None: | ||
super().__init__(config, api_version, cognite_client) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove this entire init method now. |
||
self._warning = warning | ||
self._api_subversion = "beta" | ||
|
||
def list(self) -> UnitSystemList: | ||
"""`List all supported unit systems <https://pr-50.units-api.preview.cogniteapp.com/#tag/Units/operation/list_unit_systems_api_v1_projects__project__units_systems_get>`_ | ||
"""`List all supported unit systems <https://developer.cognite.com/api#tag/Unit-Systems/operation/listUnitSystems>`_ | ||
|
||
Returns: | ||
UnitSystemList: List of unit systems | ||
|
@@ -118,5 +111,4 @@ def list(self) -> UnitSystemList: | |
>>> res = c.units.systems.list() | ||
|
||
""" | ||
self._warning.warn() | ||
return self._list(method="GET", list_cls=UnitSystemList, resource_cls=UnitSystem) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of these urls seem to work yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, but they will be there once we merge https://github.com/cognitedata/service-contracts/pull/2375
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now they work @haakonvt