GlueTransform 基类 - Amazon Glue
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

GlueTransform 基类

所有 awsglue.transforms 类继承的基类。

这些类全部定义 __call__ 方法。它们要么重写以下各节中列出的 GlueTransform 类方法,要么在默认情况下使用类名调用它们。

方法

apply(cls, *args, **kwargs)

通过调用转换类来应用转换,并返回结果。

  • clsself 类对象。

name(cls)

返回派生的转换类的名称。

  • clsself 类对象。

describeArgs(cls)

  • clsself 类对象。

返回各自与命名参数对应的字典的列表,格式如下:

[ { "name": "(name of argument)", "type": "(type of argument)", "description": "(description of argument)", "optional": "(Boolean, True if the argument is optional)", "defaultValue": "(Default value string, or None)(String; the default value, or None)" }, ... ]

在未实现它的派生转换中调用时引发 NotImplementedError 异常。

describeReturn(cls)

  • clsself 类对象。

返回具有有关返回类型的信息的字典,格式如下:

{ "type": "(return type)", "description": "(description of output)" }

在未实现它的派生转换中调用时引发 NotImplementedError 异常。

describeTransform(cls)

返回一个描述转换的字符串。

  • clsself 类对象。

在未实现它的派生转换中调用时引发 NotImplementedError 异常。

describeErrors(cls)

  • clsself 类对象。

返回各自描述此转换引发的可能异常的字典的列表,格式如下:

[ { "type": "(type of error)", "description": "(description of error)" }, ... ]

describe(cls)

  • clsself 类对象。

返回具有以下格式的对象:

{ "transform" : { "name" : cls.name( ), "args" : cls.describeArgs( ), "returns" : cls.describeReturn( ), "raises" : cls.describeErrors( ), "location" : "internal" } }