Releases: cognitedata/toolkit
Releases · cognitedata/toolkit
v0.2.0a5
cdf-tk
Added
- If a resource is referring to another resource, the
cdf-tk build
will now give a warning if the referred resource
is not found in the same build. For example, if you have a data model and is missing the space, the build command
will give a warning that the space required by the data model is missing. - The
cdf-tk build
command will now give warnings on duplicated resource. For example, if you have two files with
the same externalId in the same module, the build command will give a warning that the externalId is duplicated,
and that only the first file is used. - Support for
securityCategories
in theauth
folder. - Added support for resource type
DatapointSubscription
in thetimeseries
folder.
Fixed
- In a
function
config, if you did not setfileId
you would get an error when runningcdf-tk deploy
,
Missing required field: 'fileId'.
. ThefileId
is generated automatically when the function is created,
so it is not necessary to set it in the config file. This is now fixed. - If you do
cdf-tk init --upgrade
, on a pre0.2.0a3
version, you are met with
ERROR (ToolkitModuleVersionError): Failed to load previous version, ...
. This is now fixed. - The parameter
container.properties.<property>.type.list
was required to be set, even thought it is optional
in the CDF API. This is now fixed. - The
ExtractionPipelineConfig
create, update and delete report numbers were incorrect. This is now fixed.
Improved
- Gives a more informative error message when the authentication segment of a transformation resource file is
missing a required field. - Transformation queries can be inline, i.e. set in either the Transformation
query
property in the yaml or
as a separate file. If set in both, an error is raised because it is ambiguous which query to use. - In the
cdf-tk pull
command, if an error occurs, the temporary directory was not removed. This is now fixed. - Improved error message when running
cdf-tk deploy/clean
before runningcdf-tk build
.
Changed
- [BREAKING] In function YAML config
externalDataSetId
is renamed todataSetExternalId
to be consistent with
the naming convention used in the rest of the toolkit.
Templates
Added
- Function used to schedule & trigger workflow
- Extended
cognite_modules/examples/my_example_module
with aSecurityCategory
case. - Extended
cognite_modules/examples/my_example_module
with aDatapointSubscription
case.
Removed
- The parameter
fileId
is removed from allfunction
configurations
(cdf_functions_dummy
,cdf_data_pipeline_files_valhall
,cdf_data_pipeline_timeseries_valhall
,
andmy_example_module
) as it is no longer required. - In all modules with an
extraction_pipelines
resource, removeddataSetExternalId
andname
from all
ExtractionPipelineConfigs as this is not used and thus only causes confusion. - In all modules with a
function
, renamedexternalIdDataSet
todataSetExternalId
to be consistent with the
naming convention used in the Cognite API. - In module
my_example_module
, removedinterval
andisPaused
from the Transformation as these are not used.
These parameters should only be present in a TransformationSchedule.
Changed
- Removed schedule from annotation function
context:files:oid:fileshare:annotation
- Add use of
map_concat
in transformationfiles_oid_fileshare_file_metadata
to keep existing files metadata. - Switched to using
file.uploaded_time
instead offile.last_updated_time
since update time
potentially is updated every time the transformation runs, and don't require a reannotation.
What's Changed
- Setting canonical base url by @ronpal in #508
- [CDF-21456] No more magic by @doctrino in #509
- [CDF-21457] Speedup Tests ⚡ by @doctrino in #510
- Need4more speed by @doctrino in #512
- Raising exception if auth segment of transformation yaml lacks values by @ronpal in #511
- Query file/inline hardening by @ronpal in #514
- [CDF-20990] Cleanup temporarily build directory 🧹 by @doctrino in #515
- [CDF-21220] File id not required 🔓 by @doctrino in #516
- ci: auto-fix-linting 🚑 by @doctrino in #521
- [CDF-21484] Search system yaml 🐛 by @doctrino in #518
- Build update repo name 🛡 by @doctrino in #522
- Update README.md by @ronpal in #520
- [prep CDF-20808] Move all warnings into own module 🧱 by @doctrino in #524
- Function used to schedule Files workflow by @BergsethCognite in #523
- Added use of map_concat for metadata in transformations and use uploa… by @BergsethCognite in #534
- [prep CDF-20808, CDF-20999] Analyze parameters 🧱 by @doctrino in #525
- [prep CDF-20808, CDF-20999] Compare parameter specs 🟰 by @doctrino in #527
- [prep CDF-20808, CDF-20999] Loader support parameter spec 🛟 by @doctrino in #528
- [prep CDF-20808, CDF-20999] Robustifying spec against all examples 🪨🐛 by @doctrino in #532
- [CDF-20808, CDF-20999] Warning on bad config ⚠ by @doctrino in #533
- [CDF-21284] 🏋Base cls commands by @doctrino in #538
- Refactor
check_yaml_semantics
function by @haakonvt in #540 - [CDF-21525] 🔨Load containers fix by @doctrino in #541
- Address repo warnings by @haakonvt in #543
- Warn baseclass by @ronpal in #539
- 🏠 Build Command to Class with Standardized Warnings Part 1 by @doctrino in #544
- 🏡 Build Warnings Standardization Part 2 by @doctrino in #545
- ⚠ Warning Subpackage by @doctrino in #546
- 👷 Created command package by @doctrino in #547
- 🔨 Fixing flaky tests by @doctrino in #548
- 🕶 Cleanup validation by @doctrino in #549
- Deploy command by @ronpal in #550
- Using Warning class instead of inline warning by @ronpal in #551
- [CDF-21529] 🦗Warning on non required by @doctrino in #552
- Update config.yaml added missing required parameter "source_event" by @BergsethCognite in #554
- [CDF-21540] 🧗♂️Gather warnings per file in Build by @doctrino in #559
- build; update cognite-sdk to 7.43.5 by @doctrino in #560
- [CDF-21088] 🐫 Warning on duplicated resources by @doctrino in #561
- [CDF-21568, CDF-21569] 🪓Move deploy and clean by @doctrino in #562
- 😬Cleanup loaders by @doctrino in #564
- [CDF-21572, prep CDF-21544] 🫧 Simplify auth loader by @doctrino in #565
- [CDF-21515] ⚠Warning on dependencies by @doctrino in #567
- [CDF-21446] 👶Not case sensitive file pattern by @doctrino in #571
- 🕵Review Feedback by @doctrino in #569
- [CDF-21544] 💂♂️Support security categories by @doctrino in #570
- [CDF-21522] 💨Support datapoint subscription by @doctrino in #572
- CDF-20927 by @ronpal in #553
- [CDF-20982] 💡 Better error message by @doctrino in #574
- [CDF-21338] 👺 Warning on modify source by @doctrino in #573
- Prep release 0.2.0a5 by @doctrino in #575
Full Changelog: v0.2.0a4...v0.2.0a5
v0.1.4
cdf-tk
Fixed
- When running
cdf-tk deploy
with containerYAML
config from beforecognite-sdk<7.37
, the user would get an error
Missing required field: 'list'.
for thedirect
container properties. This is now fixed. - When running
cdf-tk init --upgrade
, the user would get an errorIndexError: list index out of range
.
This is now fixed.
Template
No changes to templates.
What's Changed
Full Changelog: v0.1.3...v0.1.4
# v0.2.0a4
cdf-tk
Removed
- [BREAKING]
cognite-tookit
no longer supportscommon_function_code
. The code used by functions must be in each
function directory. The reason for this is thatcognite-toolkit
is a tool for governance and deployment of
modules, it is not for development of functions. Thecommon_function_code
was a feature to support easier
development of functions. It is expected that functions are developed in a separate environment and then
moved to thecognite_modules
folder for deployment and promotion between environments.
Changed
- In
config.[env].yaml
, in theenvironment
section,name
is no longer required. Instead, the[env]
part
of theconfig.[env].yaml
file is used as thename
of the environment. This is to avoid redundancy.
Improved
- When running
cdf-tk clean --dry-run
the output would show local resources regardless of whether they existed
in CDF or not. This is now fixed and only resources that exist in CDF are shown in the output. - Better error message (no exception raised) if the config file has
selected_modules_and_packages
, but with no list items. - If yaml files are invalid, a link to the API docs for the resource is shown in the error message.
Fixed
- When deploying a
FunctionSchedule
that requires an update, thecdf-tk
would fail with error
Failed to update functions.schedules. Error 'FunctionSchedulesAPI' object has no attribute 'update'.
.
This is now fixed. - When calling
cdf-tk init --upgrade
, the user is met with aFailed to load previous version, ...
.
This is now fixed. - When running
cdf-tk auth verify --interactive
and the user want to create a new group with the necessary
capabilities, thecdf-tk
would successfully create a group, but then raise
an Error:cognite.client.exceptions.CogniteAPIError: Insufficient access rights.
when trying to validate.
This is now fixed.
Templates
Added
- Added Workflow with a Function and a Transformation to the cdf_data_pipeline_files_valhall example
Changed
- The
cdf_functions_dummy
module now includes codes from the formercommon_function_code
directory.
Fixed
- In
example_pump_data_model
, in thePump.view.yaml
the propertysource
usedexternal_id
instead of
externalId
.
Details
- metadata is dict, not list by @ronpal in #475
- Fix demo ts by @ronpal in #476
- Fix demo ts by @ronpal in #477
- [CDF-21166] Remove hashing of dataframe by @doctrino in #478
- [CDF-21415] Attempt at fixing flaky test by @doctrino in #479
- [CDF-21408] convert system exits to raising exceptions by @haakonvt in #459
- add error type to output msg by @haakonvt in #484
- [CDF-21340] Consistent writing cdf-tk pull by @doctrino in #482
- [CDF-21406] Remove common folder function code by @doctrino in #480
- [CDF-21423] Added warning if action and shared are in a transformation yaml by @doctrino in #481
- [CDF-21363] Remove name requirement by @doctrino in #483
- added workflow to files pipeline + fixed spelling in workflow example by @BergsethCognite in #485
- improved error handling, click/typer should not reach sentry by @haakonvt in #488
- [CDF-21235] Clean dry-run validate against CDF by @doctrino in #487
- [CDF-21453] Update Function Schedule Bug. by @doctrino in #493
- [CDF-21445] Fix init --upgrade by @doctrino in #499
- [prep for CDF-21281]To python sdk 7.39 by @doctrino in #498
- [CDF-21281] Reorg test to match package structure by @doctrino in #497
- [CDF-21248] Fix auth verify by @doctrino in #500
- [CDF-20997] Upgrade Test Guide by @doctrino in #490
- Nicer error handling for selected modules by @ronpal in #491
- CDF-21409 link to docs when resource validation fails by @ronpal in #492
- Prep 0.2.0a4 by @doctrino in #505
Full Changelog: v0.1.3...v0.2.0a4
v0.1.3
cdf-tk
Fixed
- Functions that are deployed with schedules no longer uses a short-lived session (before: failed after ~an hour).
- When deploying a
FunctionSchedule
that requires an update, thecdf-tk
would fail with error
Failed to update functions.schedules. Error 'FunctionSchedulesAPI' object has no attribute 'update'.
.
This is now fixed. - The dependency
cognite-sdk
must now be>=7.37.0
to use thecdf-tk
.
Templates
Fixed
- Updated module
apm_simple_data_model
forcognite-sdk>=7.37
, i.e., container properties
of typedirect
have nowlist: false
explicitly set. - In
example_pump_data_model
, in thePump.view.yaml
the propertysource
usedexternal_id
instead ofexternalId
.
Full Changelog: v0.1.2...v0.1.3
v0.2.0a3
cdf-tk
Added
- Support for the Workflow and WorkflowVersion resource type
- Support for specifying
selected_modules_and_packages
as paths and parent paths. For example, you can
now writecognite_modules/core/cdf_apm_base
instead of justcdf_apm_base
. This is to support
modules that have the same name but are in different parent directories. In addition, this also better reflects
the structure of thecognite_modules
andcustom_modules
folder better.
Fixed
- Functions that are deployed with schedules no longer uses a short-lived session (before: failed after ~an hour).
Changed
- [BREAKING] The
cdf-tk build
will now clean the build directory by default before building the modules to avoid
unwanted side effects from previous builds. To stop this behavior, use the--no-clean
flag. - [BREAKING] The
_system.yaml
is now required to be on the root level when running anycdf-tk
command. This
means that the_system.yaml
file must be in the same directory as theconfig.[env].yaml
files. This is to
support runningcdf-tk
without thecognite_modules
folder. - [BREAKING] In the
config.[env].yaml
files, themodules
section is now renamed tovariables
. This is to
better reflect the content of this section, which is variables that can be used in the resource files. - In addition to
cognite_modules
andcustom_modules
, thecognite-toolkit
now also supportmodules
as the
top-level folder for modules. This together with the two changes above, is to have a better support for running
thecognite-toolkit
as a standalone CLI without thecognite_modules
. - The
.gitignore
file you get by runningcdf-tk init
now ignores the/build
by default. - The dependency
cognite-sdk
must now be>=7.37.0
to use thecdf-tk
.
Templates
Fixed
- Align tag name in asset hierarchy between the 2 example transformations
- Added default root asset ID to documents for initial annotation
- Aligned use of asset external ID across contextualization functions
- Annotation logic with local time stamp for when to reprocess P&ID files
- Input to P&ID annotation based on list of synonyms for tag
- Updated module
apm_simple_data_model
forcognite-sdk>=7.37
, i.e., container properties
of typedirect
have nowlist: false
explicitly set.
Added
- Added Transformation for WorkOrder and WorkItems to OID testdata template
- Added Workflow with a Function and a Transformation to the custom module example
Details
- ci: fix trigger test on release branch as well by @doctrino in #405
- [Prep for CDF-21163] Refactor CDFToolConfig by @doctrino in #407
- [CDF-21163] feat: Support interactive login by @doctrino in #408
- Fixing P&ID annotation based on learnings from AkerBP project by @BergsethCognite in #410
- Refactor: get_auth_variables by @doctrino in #409
- Support interactive login interactively by @doctrino in #411
- Remove one initialization method in ToolCDFConfig. by @doctrino in #412
- fix: failing deploy by @doctrino in #413
- Scoped capabilites based on resource to load. by @doctrino in #414
- Fix: Avoid checking capabilities if there is no loaded resources. by @doctrino in #415
- Scoped access verify by @doctrino in #416
- Prepare for 0 2 0a1 by @doctrino in https://github.com/cognitedata/cdf-project-templates/pull/4177
- Index error initializing from token by @doctrino in #419
- [CDF-21192] Fix login issues by @doctrino in #420
- [CDF-21177] Support spaces in variables by @doctrino in #421
- ci: threshold on action by @doctrino in #422
- [CDF-21186] Remove system yaml Requirement by @doctrino in #431
- [CDF-21221] fix: container comparison by @doctrino in #433
- [CDF-21185] Error on duplicated module name by @doctrino in #435
- [CDF-21187] Allow modules name by @doctrino in #432
- [CDF-21191] Warning on missing environment variables by @doctrino in #436
- revert: CLI standalone by @doctrino in #437
- [CDF-21261] Help Breaking typer installation by @doctrino in #439
- Prepare 0.2.0a2 by @doctrino in #440
- Panid annotation fix by @BergsethCognite in #442
- function schedules should not use
oneshotTokenExchange
by @haakonvt in #444 - Fixed tests that failed when local env vars interfered by @ronpal in #455
- Replace black with ruff by @doctrino in #456
- added transformations for workorder & workitems to oid test data module by @BergsethCognite in #454
- Ignore build folder and default to clean by @doctrino in #457
- Workflow loader by @ronpal in #453
- Tests: Migration by @doctrino in #458
- [CDF-21255] Standalone CLI by @doctrino in #460
- New ruff location by @doctrino in #466
- Example with workflow by @ronpal in #465
- Migration tests updated by @doctrino in #470
- set release in
sentry_sdk.init
by @haakonvt in #471 - [CDF-21405] Modules selected by path by @doctrino in #469
- Migration: Handle moved system.yaml by @doctrino in #472
- Prepare 0.2.0a3 Release by @doctrino in #473
- metadata is dict, not list by @ronpal in #475
- Fix demo ts by @ronpal in #476
Full Changelog: v0.1.2...v0.2.0a3
v0.2.0a2
cdf-tk
Added
- Variables can now have extra spaces between curly braces and the variable name. For example,
{{ my_variable }}
is now
a valid variable. Before this change, you would have to write{{my_variable}}
. - If an environment variable is not found in a resource file, for example,
${CDF_CLUSTER}
, when
runningcdf-tk deploy
the user will now get a warning message that the variable is missing. Before this change,
this would pass silently and potentially cause an error when trying to deploy to CDF that was hard to debug.
Fixed
- When running
cdf-tk
with a Token for initialization, thecdf-tk
would raise anIndexError
. This is now fixed. - Container resources that did not have set the optional property
usedFor
would always be classified as changed,
when, for example, runningcdf-tk deploy --dry-run
. This is now fixed.
Changed
- If two modules have the same name, the
cdf-tk build
command will now stop and raise an error. Before this change,
thecdf-tk build
command would continue and overwrite the first module with the second module.
Templates
No changes to templates.
Details
- Index error initializing from token by @doctrino in #419
- [CDF-21192] Fix login issues by @doctrino in #420
- [CDF-21177] Support spaces in variables by @doctrino in #421
- ci: threshold on action by @doctrino in #422
- [CDF-21221] fix: container comparison by @doctrino in #433
- [CDF-21185] Error on duplicated module name by @doctrino in #435
- [CDF-21191] Warning on missing environment variables by @doctrino in #436
- revert: CLI standalone by @doctrino in #437
- [CDF-21261] Help Breaking typer installation by @doctrino in #439
- Prepare 0.2.0a2 by @doctrino in #440
Full Changelog: v0.1.2...v0.2.0a2
v0.2.0a1
v0.2.0a1
cdf-tk
Added
- Support for interactive login. The user can now set
LOGIN_FLOW=interactive
in the.env
file
to use interactive login.
Changed
- The verification of access by the tool is now scoped to the resources that are being deployed instead of
the entire project. This means that if the user only has access to a subset of the resources in the project,
the tool will still be able to deploy those resources.
Templates
Added
- Added functionality for wildcard detection of tags in P&ID
- Added functionality for multiple overlapping annotation to same tag - related to wildcards
Details
- Release 0.1.0b2 by @gregertw in #243
- Release 0.1.0b3 by @doctrino in #254
- Release 0.1.0b4 by @ronpal in #271
- Release 0.1.0b5 by @doctrino in #284
- Release 0.1.0b6 by @doctrino in #298
- Missing env variables by @doctrino in #301
- Release 0.1.0b6 by @doctrino in #302
- B7 merge by @ronpal in #321
- Release 0.1.0b7 by @ronpal in #320
- fix: hotfix common modules (#322) by @ronpal in #323
- Release 0.1.0b7 by @ronpal in #324
- Release 0.1.0b8 by @doctrino in #344
- Release 0.1.0b9 by @ronpal in #358
- Release 0.1.0 by @doctrino in #380
- Release 0.1.1 by @doctrino in #385
- Release 0.1.2 by @doctrino in #404
- ci: fix trigger test on release branch as well by @doctrino in #405
- [Prep for CDF-21163] Refactor CDFToolConfig by @doctrino in #407
- [CDF-21163] feat: Support interactive login by @doctrino in #408
- Fixing P&ID annotation based on learnings from AkerBP project by @BergsethCognite in #410
- Refactor: get_auth_variables by @doctrino in #409
- Support interactive login interactively by @doctrino in #411
- Remove one initialization method in ToolCDFConfig. by @doctrino in #412
- fix: failing deploy by @doctrino in #413
- Scoped capabilites based on resource to load. by @doctrino in #414
- Fix: Avoid checking capabilities if there is no loaded resources. by @doctrino in #415
- Scoped access verify by @doctrino in #416
- Prepare for 0 2 0a1 by @doctrino in #417
Full Changelog: v0.1.2...v0.2.0a1
v0.1.2
cdf-tk
Fixed
- Running the command
cdf-tk auth verify --interactive
without a.env
would raise a
AttributeError: 'CDFToolConfig' object has no attribute '_client'
error. This is now fixed and instead the user
gets a guided experience to set up the.env
file.
Changed
cognite-toolkit
have moved the upper bound on thecognite-sdk
dependency from7.27
to8.0
.- Creating/Removing
spaces
no longer requiresDataModelingInstances
capability.
Templates
No changes to templates.
Details
- Gtw/big_smoke_tests by @gregertw in #389
- Ts data pipeline by @BergsethCognite in #386
- [CDF-21089] Avoid raising exception if .env is missing by @doctrino in #396
- [CDF-21160] Move upper bound for cognite-sdk by @doctrino in #397
- Lock file maintenance by @renovate in #388
- [CDF-21162] Data modeling capabilities by @doctrino in #400
- removed metadata related to contextualization that not was relevant by @BergsethCognite in #401
- Prep 0.1.2 by @doctrino in #403
Full Changelog: v0.1.1...v0.1.2
v0.1.1
cdf-tk
Fixed
- When running
cdf-tk clean
orcdf-tk deploy --drop-data
for a data model with more than 10 containers,
the command would raise an APIError. This is now fixed. - A few minor potential
AttributeError
andKeyError
bugs have been fixed.
Templates
No changes to templates.
Full Changelog: v0.1.0...v0.1.1
v0.1.0
cdf-tk
Added
- Command
cdf-tk dump datamodel
for dumping data models from CDF into a local folder. The use case for this is to
dump an existing data model from CDF and use it as a basis for building a new custom module with that data model. - A Python package API for the cdf-tk. This allows for programmatic access to the cdf-tk functionality. This
is limited to thebuild
anddeploy
functionality. You can start byfrom cognite_toolkit import CogniteToolkit
.
Fixed
- In the function deployment, the hashing function used of the directory was independent of the location of the files
within the function directory. This caused moving files not to trigger a redeployment of the function. This is now
fixed.
Changed
- Removed unused dependencies
mypy
,pyarrow
andchardet
fromcognite-toolkit
package. - Lowered the required version of
pandas
to1.5.3
in thecognite-toolkit
package.
Templates
Changed
- In the
infield
section, theinfield_apm_app_config.node.yaml
was moved fromcdf_infield_location
tocdf_infield_common
module. In addition, the modulecdf_infield_second_location
was added to theinfield
section. This is to demonstrate
how multiple locations in Infield should be handled. - In the
cdf_data_pipeline_files_valhall
example, the Cognite Functionfu_context_files_oid_fileshare_annotation
has been renamed tofn_context_files_oid_fileshare_annotation
. It has also been split into several files, to be
easier to understand. It has also been changed to usingprint
s (overlogging
), as that is unfortunately a hard
requirement from the API.
Added
- In the
cdf_data_pipeline_files_valhall
example, theREADME.md
file has been updated with instructions on how to
run and test Cognite Functions locally.
New Contributors
Full Changelog: v0.1.0b9...v0.1.0