Skip to content

Commit

Permalink
auto-expand instance properties in notebooks (#1853)
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonvt authored Jul 19, 2024
1 parent da278ec commit 8c80c8c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ Changes are grouped as follows
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [7.54.3] - 2024-07-17
## [7.54.4] - 2024-07-19
### Changed
- Instance classes like `Node` and `NodeList` now expand properties by default in notebook-like environments.

## [7.54.3] - 2024-07-18
### Added
- [Feature Preview] Support for `enum` as container property type in the data modeling APIs. Note that this is not
yet supported in the API, and is an experimental feature that may change without warning.
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations

__version__ = "7.54.3"
__version__ = "7.54.4"
__api_subversion__ = "20230101"
8 changes: 6 additions & 2 deletions cognite/client/utils/_pandas_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ def concat_dps_dataframe_list(


def notebook_display_with_fallback(inst: T_CogniteResource | T_CogniteResourceList, **kwargs: Any) -> str:
if "camel_case" in signature(inst.to_pandas).parameters:
# Default of False enforced (when accepted by method):
params = signature(inst.to_pandas).parameters
# Default of False enforced (when accepted by method):
if "camel_case" in params:
kwargs["camel_case"] = False
# TODO: Next major, flip this default to True in the method itself (and delete here):
if "expand_properties" in params:
kwargs["expand_properties"] = True
try:
return inst.to_pandas(**kwargs)._repr_html_()
except CogniteImportError:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "cognite-sdk"

version = "7.54.3"
version = "7.54.4"
description = "Cognite Python SDK"
readme = "README.md"
documentation = "https://cognite-sdk-python.readthedocs-hosted.com"
Expand Down

0 comments on commit 8c80c8c

Please sign in to comment.