GlueTransform base 類別 - AWS Glue

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

GlueTransform base 類別

所有 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" } }