Skip to content

Conversation

@doctrino
Copy link
Collaborator

@doctrino doctrino commented Nov 5, 2025

Description

Context Cognite Toolkit have pydantic classes for all resources we support. This class is used to validate user input and give good error messages if they mistype.

This PR add the InfieldCDMv1YAML class that will be used when supporting the new infield configuration format.

I built the InfieldLocationConfigYAML based on the InfeildLocationConfig in the InField system model, and I used the #2159 for all the JSONObjects.

image

Changelog

  • Patch
  • Skip

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
25892 21822 84% 80% 🟢

New Files

File Coverage Status
cognite_toolkit/_cdf_tk/resource_classes/infield_cdmv1.py 100% 🟢
TOTAL 100% 🟢

Modified Files

No covered modified files...

updated for commit: 8b26de4 by action🐍

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.28%. Comparing base (2fec294) to head (8b26de4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2171      +/-   ##
==========================================
+ Coverage   84.25%   84.28%   +0.02%     
==========================================
  Files         262      263       +1     
  Lines       25850    25892      +42     
==========================================
+ Hits        21781    21822      +41     
- Misses       4069     4070       +1     
Files with missing lines Coverage Δ
..._toolkit/_cdf_tk/resource_classes/infield_cdmv1.py 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

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

@doctrino doctrino marked this pull request as ready for review November 5, 2025 14:07
@doctrino doctrino requested review from a team as code owners November 5, 2025 14:07

root_location_external_id: str | None = None
feature_toggles: FeatureToggles | None = None
classic_asset_external_id: str | None = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
classic_asset_external_id: str | None = None

not going to be used in v2, can be removed.

feature_toggles: FeatureToggles | None = None
classic_asset_external_id: str | None = None
app_instance_space: str | None = None
app_data_set: str | None = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
app_data_set: str | None = None

not going to be used in v2, can be removed.


appInstanceSpace: my_app_instance_space

appDataSet: my_infield_dataset
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
appDataSet: my_infield_dataset

not going to be used in v2, can be removed.

notificationsEndpointExternalId: notifications_endpoint_001
attachmentsEndpointExternalId: attachments_endpoint_001

classicAssetExternalId: root_asset_external_id_123
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
classicAssetExternalId: root_asset_external_id_123

not going to be used in v2, can be removed.

Comment on lines 36 to 38
datasetIds:
- 12345
- 67890
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
datasetIds:
- 12345
- 67890

not going to be used in v2, can be removed.

Comment on lines 49 to 50
datasetIds:
- 12345
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
datasetIds:
- 12345

not going to be used in v2, can be removed.

Comment on lines 54 to 56
datasetIds:
- 12345
- 67890
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
datasetIds:
- 12345
- 67890

not going to be used in v2, can be removed.

Comment on lines 59 to 60
datasetIds:
- 12345
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
datasetIds:
- 12345

not going to be used in v2, can be removed.

Comment on lines 75 to 78
class ObservationConfig(BaseModelResource):
external_id: str
root_location_external_ids: list[str] | None = None
field_configurations: dict[str, Any] | None = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class ObservationConfig(BaseModelResource):
external_id: str
root_location_external_ids: list[str] | None = None
field_configurations: dict[str, Any] | None = None

Not in use in V2

Comment on lines 64 to 77
observationConfig:
externalId: observation_config_001
rootLocationExternalIds:
- location_001
- location_002
fieldConfigurations:
field_1:
type: text
label: Description
required: true
field_2:
type: number
label: Temperature
unit: celsius
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
observationConfig:
externalId: observation_config_001
rootLocationExternalIds:
- location_001
- location_002
fieldConfigurations:
field_1:
type: text
label: Description
required: true
field_2:
type: number
label: Temperature
unit: celsius

not going to be used in v2, can be removed.

@doctrino doctrino enabled auto-merge (squash) November 6, 2025 12:34
Copy link
Collaborator

@ronpal ronpal left a comment

Choose a reason for hiding this comment

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

👷

@doctrino doctrino merged commit 912f56e into main Nov 6, 2025
14 checks passed
@doctrino doctrino deleted the infieldv2-yaml branch November 6, 2025 12:37
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.

4 participants