Skip to main content

system.kanoa.quality.config.updateDataSource

Requires kanoaQDS license

Description

Updates an attribute datasource.

Syntax

updateDataSource(attrInfo, userId)

Parameters:
  • attrInfo (dict): Dictionary
  • userId (int): User ID

  • Returns:
  • modifiedRecords (int): Number of records modified during the update.
  • msg (str): Message indicating the result of the update.
  • Dictionary

    ParameterTypeRequiredNotes
    attributeDataSourceIdintNoe.g. 67
    attributeIdintNoe.g. 3
    assetIdintNoe.g. 5
    sourceTagPathstrNoe.g. 'some tag path'
    scaleFactorfloatNoe.g. 1.0
    ignoreZeroValuesboolNoe.g. True
    enabledboolNoe.g. True

    Code Examples

    # Usage example
    attr_info = {'attributeDataSourceId': 67, 'attributeId': 3, 'assetId': 5, 'sourceTagPath': 'some tag path', 'scaleFactor': 1.0, 'ignoreZeroValues': True, 'enabled': True}
    modified_records, update_msg = system.kanoa.quality.config.updateDataSource(attrInfo=attr_info, userId=123)

    if modified_records is not None:
    print(f"Successfully updated {modified_records} records")
    else:
    print(f"Update failed. Error: {update_msg}")