Skip to content
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

[NEAT-41] Export to CDF and Integration Test #283

Merged
merged 11 commits into from
Mar 1, 2024
Merged

Conversation

doctrino
Copy link
Collaborator

@doctrino doctrino commented Feb 29, 2024

Overall got the DMS Export to DMS to work in the first iteration (still more validation to add). On the way I ran into multiple obstacles that resulted in the following.

  • Added check to InformationRules that all classes have at least one property.
  • Added a few properties to the InformationRules sheet for the classes with no properties.
  • Implement DMSExporters.export_to_cdf.
  • Added validation to ensure direct relations are nullable, updated conversion from Information Architect to reflect this. (Even if the Information Model requires a direct relation, it is set to nullable).

T_WritableCogniteResourceList = TypeVar("T_WritableCogniteResourceList", bound=WriteableCogniteResourceList)


class ResourceLoader(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is steeling a concept from cdf-toolkit. However, I thing it is equally useful for us to be able to tell the user results of dry runs and have a standardized interface towards cognite resources.

@doctrino doctrino marked this pull request as ready for review February 29, 2024 19:33
cognite/neat/rules/exceptions.py Outdated Show resolved Hide resolved
cognite/neat/rules/exceptions.py Show resolved Hide resolved
from dataclasses import dataclass, field
from functools import total_ordering


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we call this module _models ? not really religious

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it.

cognite/neat/rules/exporters/_loaders.py Outdated Show resolved Hide resolved
cognite/neat/rules/exporters/_loaders.py Outdated Show resolved Hide resolved
def delete(self, ids: SequenceNotStr[DataModelId]) -> list[DataModelId]:
return self.client.data_modeling.data_models.delete(cast(Sequence, ids))

def are_equal(self, local: DataModelApply, remote: DataModel) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this local and remote. We should remebre to use same naming for Asset Loader.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is already there in the new AssetLoader implementation.

cognite/neat/rules/exporters/_rules2dms.py Show resolved Hide resolved
cognite/neat/rules/models/_rules/information_rules.py Outdated Show resolved Hide resolved
@doctrino doctrino merged commit d9ca4c5 into main Mar 1, 2024
6 checks passed
@doctrino doctrino deleted the integration-test branch March 1, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants