【问题标题】:How do I pass an object from an azure data factory lookup to a notebook so I can use the object/json within a python script如何将对象从 azure 数据工厂查找传递到笔记本,以便我可以在 python 脚本中使用对象/json
【发布时间】:2019-05-01 15:09:37
【问题描述】:

我是第一次使用 Azure 数据工厂。

我查找了一个源数据集,该数据集是来自 azure 表存储的表

我有一个笔记本,它有一个名为“输入”的基本参数,其值为:

@activity('Lookup1').output

笔记本路径引用了一个尚未执行任何操作的 python 脚本。

当我尝试调试管道时,我得到了错误:

{
    "errorCode": "2105",
    "message": "The value type 'System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxx],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxx]]', in key 'input' is not expected type 'System.String'",
    "failureType": "UserError",
    "target": "Notebook1"
}

我希望能够在 python 脚本中使用 json 对象。我是否必须以某种方式更改基本参数才能序列化对象?

【问题讨论】:

    标签: azure azure-table-storage azure-data-factory azure-databricks


    【解决方案1】:

    您可以使用@string 将其转换为字符串: https://docs.microsoft.com/nl-nl/azure/data-factory/control-flow-expression-language-functions#conversion-functions

    这应该可以工作:@string(activity('Lookup1').output)

    这会将对象转换为 json 字符串,您可能可以在笔记本中解析它。

    【讨论】:

    • 当我尝试在 python 中使用参数('input')时,它说它没有定义
    猜你喜欢
    • 2022-08-19
    • 2014-06-06
    • 1970-01-01
    • 2017-06-28
    • 1970-01-01
    • 1970-01-01
    • 2013-07-15
    • 2015-06-21
    • 2016-08-03
    相关资源
    最近更新 更多