-
Notifications
You must be signed in to change notification settings - Fork 2
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-236] DMS Exporter Support downloading Solution with Enterprise 🧑🧒 #448
Conversation
f29075c
to
02f670b
Compare
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
cls, | ||
client: CogniteClient, | ||
data_model_id: DataModelIdentifier, | ||
reference_model_id: DataModelIdentifier | None = None, |
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.
I agree that being explicit with stating reference_mode_id. Later on we can add magic of inference, but my worry is if that we might bump into data models not created by neat that might be derived from having more than one reference.
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.
That is an interesting discussion, will add it to tech debt
client: CogniteClient, | ||
data_model_id: DataModelIdentifier, | ||
reference_model_id: DataModelIdentifier | None = None, | ||
) -> "DMSImporter": |
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.
With this method we only support getting the latest version. We could have mismatch that for some reason user data model was created on top of reference data model, which version is not latest.
So maybe add NOTE.
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, you can specify whatever datamodel version you want.
DataModelIdentifier = tuple[str, str] | tuple[str, str, strr] | dm.DataModelingId
Adds option for Importing solution model with enterprise, shown with the argument
reference_model_id
below.It is tempting to allow for
DMSImporter.from_data_model_id(cognite_client, solutiom_model, reference_model_id="infer")
. However, I think we should follow the principle of being explicit here.Note that this opens up for a new type of warning, you can have a reference model that is not referenced by the use model. (and potentially some other issues as well which I have not thought about). I have logged that in this task: https://cognitedata.atlassian.net/browse/NEAT-247.
I think one of the principles I realized working on this, is to avoid mixing the logic and validation if you can. If you are missing a data model, then it is an error an you have to return it as an error, but warnings like reference model not being referenced should be likely kept to the
.validation
method of the schema.