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-343] 🎢 Asset Migration Toy Example Tutorial #531

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

doctrino
Copy link
Collaborator

@doctrino doctrino commented Jul 9, 2024

No description provided.

Copy link

github-actions bot commented Jul 9, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
22456 15680 70% 60% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
cognite/neat/graph/loaders/_base.py 77% 🟢
cognite/neat/graph/loaders/_rdf2dms.py 73% 🟢
TOTAL 75% 🟢

updated for commit: 8625df5 by action🐍

@doctrino doctrino marked this pull request as ready for review July 9, 2024 05:47
@doctrino doctrino requested a review from a team as a code owner July 9, 2024 05:47
Comment on lines +283 to +292
for instance_type, instances in {"Nodes": upserted.nodes, "Edges": upserted.edges}.items():
result = UploadResult[InstanceId](name=instance_type, issues=read_issues)
for instance in instances: # type: ignore[attr-defined]
if instance.was_modified and instance.created_time == instance.last_updated_time:
result.created.add(instance.as_id())
elif instance.was_modified:
result.changed.add(instance.as_id())
else:
result.unchanged.add(instance.as_id())
yield result
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 change to the code is to get a better feedback to the user.

Instead of
image

We now get
image

issues = NeatIssueList[NeatIssue]()
items = []
if items:
yield self._upload_to_cdf(client, items, dry_run, issues)
yield from self._upload_to_cdf(client, items, dry_run, issues)

@abstractmethod
def _get_required_capabilities(self) -> list[Capability]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

considering issue that we bump into when client IAM did not have any cap. do we have a fall back when loader will attempt to push things to CDF?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what you mean here.

result.changed.add(instance.as_id())
else:
result.unchanged.add(instance.as_id())
yield result
Copy link
Collaborator

Choose a reason for hiding this comment

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

b8tiul :)

@doctrino doctrino merged commit 517e1b0 into main Jul 9, 2024
7 checks passed
@doctrino doctrino deleted the finish-asset-migration-toy-example branch July 9, 2024 08:19
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