-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NEAT-33] Exporter DMS Workflow (#286)
* feat: Exporter Step * fix: creation of workflow * refactor: Update export to cdf workflow * refactor: additional testing * fix: bug in importer * refactor; fix' * feat: added export DMS * refactor: fix line endings
- Loading branch information
Showing
11 changed files
with
270 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
configs: [] | ||
description: null | ||
implementation_module: null | ||
name: Export DMS | ||
steps: | ||
- complex_configs: {} | ||
configs: {} | ||
description: null | ||
enabled: true | ||
id: step_861205 | ||
label: Upload Rules Spreadsheet | ||
max_retries: 0 | ||
method: null | ||
params: | ||
file_type: rules | ||
retry_delay: 3 | ||
stype: file_uploader | ||
system_component_id: null | ||
transition_to: | ||
- step_295479 | ||
trigger: true | ||
ui_config: | ||
pos_x: 630 | ||
pos_y: 69 | ||
- complex_configs: {} | ||
configs: | ||
Report Formatter: html | ||
role: infer | ||
description: null | ||
enabled: true | ||
id: step_295479 | ||
label: Validate | ||
max_retries: 0 | ||
method: ImportExcelValidator | ||
params: {} | ||
retry_delay: 3 | ||
stype: stdstep | ||
system_component_id: null | ||
transition_to: | ||
- step_50885 | ||
trigger: false | ||
ui_config: | ||
pos_x: 630 | ||
pos_y: 180 | ||
- complex_configs: | ||
components: | ||
containers: true | ||
data_models: true | ||
spaces: true | ||
views: true | ||
configs: | ||
dry_run: 'False' | ||
existing_component_handling: update | ||
multi_space_components_create: 'True' | ||
description: null | ||
enabled: true | ||
id: step_50885 | ||
label: Export Data Model to CDF | ||
max_retries: 0 | ||
method: ExportDataModelStorage | ||
params: {} | ||
retry_delay: 3 | ||
stype: stdstep | ||
system_component_id: null | ||
transition_to: [] | ||
trigger: false | ||
ui_config: | ||
pos_x: 630 | ||
pos_y: 274 | ||
system_components: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
Empty file.
20 changes: 20 additions & 0 deletions
20
tests/tests_unit/rules/test_importers/test_excel_importer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from cognite.neat.rules.importers import ExcelImporter | ||
from tests.config import DOC_KNOWLEDGE_ACQUISITION_TUTORIAL | ||
|
||
|
||
def valid_rules_filepaths(): | ||
yield pytest.param(DOC_KNOWLEDGE_ACQUISITION_TUTORIAL / "cdf-dms-architect-alice.xlsx", id="Alice rules") | ||
|
||
|
||
class TestExcelImporter: | ||
@pytest.mark.parametrize("filepath", valid_rules_filepaths()) | ||
def test_import_valid_rules(self, filepath: Path): | ||
importer = ExcelImporter(filepath) | ||
|
||
rules = importer.to_rules() | ||
|
||
assert rules |