cognite-sdk-python icon indicating copy to clipboard operation
cognite-sdk-python copied to clipboard

Transformation schema for nodes and edges with view centric and model centric

Open nimeshawij opened this issue 1 year ago • 4 comments

Description

Transformation schema for nodes, edges in both view centric and model centric

_api\transformations\schema.py

  1. Added condition to check destination.type "nodes" or "edges" or "instances", then set the resource path /transformation/schema/instances.

Because all other resource paths are in the format /transformation/schema/{destination.type}

  1. withInstanceSpace, isConnectionDefinition, instanceType are optional

  2. Examples

  • Get the schema for a transformation producing nodes::
  • Get the schema for a transformation producing edges::
  • Get the schema for a transformation producing instance type data model::
  • Get the schema for a transformation producing instance relationship data model::

tests\tests_integration\test_api\test_transformations\test_schema.py

Added test_nodes_with_view(self, cognite_client) test_edges_with_view(self, cognite_client) test_instance_type_data_model(self, cognite_client) test_instance_relationship_data_model(self, cognite_client)

Checklist:

  • [x] Tests added/updated.
  • [ ] Documentation updated. Documentation is generated from docstrings - these must be updated according to your change. If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • [x] Changelog updated in CHANGELOG.md.
  • [x] Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

nimeshawij avatar Jun 07 '23 08:06 nimeshawij

Codecov Report

Merging #1245 (0541481) into master (491a22a) will decrease coverage by 0.01%. The diff coverage is 100.00%.

:exclamation: Current head 0541481 differs from pull request most recent head b46eb42. Consider uploading reports for the commit b46eb42 to get more accurate results

@@            Coverage Diff             @@
##           master    #1245      +/-   ##
==========================================
- Coverage   90.88%   90.87%   -0.01%     
==========================================
  Files          99       99              
  Lines       11428    11429       +1     
==========================================
  Hits        10386    10386              
- Misses       1042     1043       +1     
Impacted Files Coverage Δ
cognite/client/_api/transformations/schema.py 100.00% <100.00%> (ø)
cognite/client/_version.py 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

codecov[bot] avatar Jun 07 '23 08:06 codecov[bot]

@audunska This PR cannot merge. Do I need more reviewers?

nimeshawij avatar Jun 08 '23 12:06 nimeshawij

@SunilVenekarKrishnamoorthy waiting for + one person approval to merge.

nimeshawij avatar Jun 13 '23 16:06 nimeshawij

@erlendvollset Requested changers has been done. Could you please review the code?

build/test_full failed due to below error, which is not related to this PR.

    ]
FAILED tests/tests_integration/test_api/test_data_modeling/test_instances.py::TestInstancesAPI::test_retrieve_nodes_and_edges - AssertionError: assert [NodeId(space...keitel'), ...] == [NodeId(space...keitel'), ...]
  At index 58 diff: NodeId(space='erlendtestspace', external_id='test2') != NodeId(space='erlendtestspace', external_id='test')
  Full diff:

nimeshawij avatar Jun 21 '23 08:06 nimeshawij

Closing as stale. Feel free to reopen when you have time to work on this!

haakonvt avatar Jul 21 '24 19:07 haakonvt