我正在尝试使用Boto3在quicksight中自动创建数据集。 但我有点困惑。请任何人帮助解决这个问题。 这是我的代码:
qs = boto3.client('quicksight')
response = qs.describe_data_set(
AwsAccountId='xxxxxxxx',
DataSetId='testdatasetv4'
)
columns =response['DataSet']['PhysicalTableMap']['string']['RelationalTable']['InputColumns']
for dic in columns:
for key in dic:
print({dic[key]})
我需要这样的输出:
response1 = Client.create_data_set(
AwsAccountId=data['AwsAccountId1'],
DataSetId=data['DatasetId'],
Name='testdataset',
PhysicalTableMap={
'string': {
'RelationalTable': {
'DataSourceArn':response['Arn'],
'Schema': 'public',
'Name': 'sales',
'InputColumns': [
{
'Name': 'salesid',
'Type': 'INTEGER'
},
{
'Name': 'listid',
'Type': 'INTEGER'
},
{
'Name': 'sellerid',
'Type': 'INTEGER'
},
{
'Name': 'buyerid',
'Type': 'INTEGER'
},
{
'Name': 'eventid',
'Type': 'INTEGER'
},
{
'Name': 'dateid',
'Type': 'INTEGER'
},
{
'Name': 'qtysold',
'Type': 'INTEGER'
},
{
'Name': 'pricepaid',
'Type': 'DECIMAL'
},
{
'Name': 'commission',
'Type': 'DECIMAL'
},
{
'Name': 'saletime',
'Type': 'DATETIME'
},
]
}
}
},
如何通过代码添加上述输入列。我可以提取输入列,但我没有任何想法添加输入列。请帮我做这个
下面是创建字典和添加不同嵌套元素的示例。你需要适应这个解决方案
相关问题 更多 >
编程相关推荐