dataassetimport properties

Data Asset Import node icon You can use the Data Asset import node to pull in data from remote data sources using connections or from your local computer.

Example

import json

stream = modeler.script.stream()

dataassetimport = stream.findByID("<import nodeId>")
# loads the string settings as a json object
userSettings = json.loads(dataassetimport.getPropertyValue("user_settings"))

userSettings["interactionProperties"]["sheet_name"] = "<new sheet name>"
dataassetimport.setPropertyValue("user_settings", json.dumps(userSettings))
Table 1. dataassetimport properties
Property name Data type Property description
asset_type DataAsset
Connection
Specify your data type: DataAsset or Connection.
asset_id string When DataAsset is set for the asset_type, this is the ID of the asset.
asset_name string When DataAsset is set for the asset_type, this is the name of the asset.
connection_id string When Connection is set for the asset_type, this is the ID of the connection.
connection_name string When Connection is set for the asset_type, this is the name of the connection.
connection_path string When Connection is set for the asset_type, this is the path of the connection.
user_settings string Escaped JSON string containing the interaction properties for the connection. Contact IBM for details about available interaction points.

Example:

"{\"interactionProperties\":
{\"file_format\":\"csv\",\"encoding\":\"UTF-
8\",\"first_line_header\":true,\"infer_schema\":true,\"infer_record_co
unt\":1000,\"infer_as_varchar\":false,\"invalid_data_handling\":\"fail
\",\"file_name\":\"input.csv\"}}"

These values will change based on the type of connection you're using.