Skip to content

[CDF-26860] 🐛Fix Neat to Toolkit export.#1593

Merged
doctrino merged 6 commits intomainfrom
fix-toolkit-export
Mar 23, 2026
Merged

[CDF-26860] 🐛Fix Neat to Toolkit export.#1593
doctrino merged 6 commits intomainfrom
fix-toolkit-export

Conversation

@doctrino
Copy link
Copy Markdown
Contributor

@doctrino doctrino commented Mar 21, 2026

Description

I found a few issues with the Neat to Toolkit export

  1. The resource folder in Toolkit has been renamed from data_models to data_modeling.
  2. You are not allowed to deploy to system spaces, so skipping all of these in the export function. If not you will get the following API error Request failed with status code 400: Space cannot start with the reserved prefix: 'cdf_'. Invalid value: 'cdf_apps_shared'.
  3. Neat sets a lot None values, which leads Toolkit to redeploy unchanged views, containers. Skipped that as well.

Bump

  • Patch
  • Skip

Changelog

Fixed

  • When exporting from Neat to Toolkit, neat.physical_data_model.write.yaml(..., format="toolkit"), Neat no longer includes resources in system spaces, writes to a resoruce folder named data_modeling, and skips null values.

Improved

  • To export Neat to Toolkit in directory format, for example, neat.physical_data_model.write.yaml("my_module" format="toolkit"), then the directory does not need to exist before calling the function.

@gemini-code-assist
Copy link
Copy Markdown
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
Copy Markdown

github-actions bot commented Mar 21, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7424 6858 92% 90% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
cognite/neat/_data_model/exporters/_api_exporter.py 92% 🟢
cognite/neat/_plugin/_manager.py 89% 🟢
TOTAL 90% 🟢

updated for commit: fe98d96 by action🐍

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.82%. Comparing base (9a95a2e) to head (fe98d96).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ognite/neat/_data_model/exporters/_api_exporter.py 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1593      +/-   ##
==========================================
- Coverage   91.85%   91.82%   -0.03%     
==========================================
  Files         126      130       +4     
  Lines        7468     7564      +96     
==========================================
+ Hits         6860     6946      +86     
- Misses        608      618      +10     
Files with missing lines Coverage Δ
cognite/neat/_plugin/_manager.py 88.63% <ø> (ø)
...ognite/neat/_data_model/exporters/_api_exporter.py 90.62% <90.00%> (-1.54%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@doctrino
Copy link
Copy Markdown
Contributor Author

/gemini review

@doctrino doctrino marked this pull request as ready for review March 21, 2026 12:16
@doctrino doctrino requested a review from a team as a code owner March 21, 2026 12:16
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several fixes to the Neat to Toolkit export functionality, such as updating the resource directory name, skipping components in system spaces, and excluding null values from the output. The changes are well-implemented and include corresponding tests. My review includes one high-severity comment regarding the skipping of system-space components. Silently skipping the main data model file can lead to an invalid export, and I've suggested a more explicit failure mechanism to improve user experience.


"""

if file_path.is_dir():
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The is_dir assumes the directory is already existing, which is not so user friendly. I think this improves useability.

@doctrino doctrino merged commit 2786bd5 into main Mar 23, 2026
10 checks passed
@doctrino doctrino deleted the fix-toolkit-export branch March 23, 2026 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