Skip to content

Conversation

@Magssch
Copy link
Contributor

@Magssch Magssch commented Dec 2, 2025

Description

When using cdf data download canvas, the existingVersion fields from DMS were kept on the Canvas instance and container instance dump, which meant it was impractical to upload it into another CDF project with cdf data upload since this would lead to a version conflict in CDF (HTTP 400). This is fixed by enabling the existing keep_existing_version parameter in IndustrialCanvasApply.dump()

resourceId was also being stripped from all Canvas ContainerReference instances. However for dataGrid and Charts these are required to be set to the value -1 and cdf data upload would previously fail in ContainerReference.__init__() when uploading any canvas with either of these included, since resourceId is a required field (both in this model and the DM).
For other resource types, we have existing logic which automatically replaces resourceId based on externalId, however this did not work for charts and dataGrid due to these being special-cases.

  • For charts the chartsId property in ContainerReference is used instead to reference the Chart. This is a reference to the Chart's externalId, which is the same used when uploading Charts, so this works without replacing any internal ID with the external ID.
  • For dataGrid, these are fully contained in their entirety within the ContainerReference instance, so no need for more logic to look up external resources.

Bump

  • Patch
  • Skip

Changelog

Fixed

  • Fixed a bug in cdf data download canvas that made it impractical to upload the canvas dump to a different CDF project
  • cdf data download canvas now retains the expected format of dataGrid and charts Canvas containers, making canvases containing these types of containers also supported when uploading canvases with cdf data upload.

@Magssch Magssch requested review from a team as code owners December 2, 2025 15:31
@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
27762 23492 85% 80% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
cognite_toolkit/_cdf_tk/storageio/_applications.py 86% 🟢
TOTAL 86% 🟢

updated for commit: 546d381 by action🐍

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.61%. Comparing base (53fbbee) to head (546d381).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2276      +/-   ##
==========================================
+ Coverage   84.60%   84.61%   +0.01%     
==========================================
  Files         281      281              
  Lines       27760    27762       +2     
==========================================
+ Hits        23487    23492       +5     
+ Misses       4273     4270       -3     
Files with missing lines Coverage Δ
cognite_toolkit/_cdf_tk/storageio/_applications.py 85.76% <100.00%> (+1.27%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@doctrino doctrino left a comment

Choose a reason for hiding this comment

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

Good stuff

@Magssch Magssch enabled auto-merge (squash) December 3, 2025 07:08
@Magssch Magssch merged commit ca5e8c0 into main Dec 3, 2025
14 checks passed
@Magssch Magssch deleted the fix-canvas-io branch December 3, 2025 07:10
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.

3 participants