

# GlueTransform 基类
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform"></a>

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

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

## 方法
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-_methods"></a>
+ [apply(cls, \$1args, \$1\$1kwargs)](#aws-glue-api-crawler-pyspark-transforms-GlueTransform-apply)
+ [name(cls)](#aws-glue-api-crawler-pyspark-transforms-GlueTransform-name)
+ [describeArgs(cls)](#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeArgs)
+ [describeReturn(cls)](#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeReturn)
+ [describeTransform(cls)](#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeTransform)
+ [describeErrors(cls)](#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeErrors)
+ [describe(cls)](#aws-glue-api-crawler-pyspark-transforms-GlueTransform-describe)

## apply(cls, \$1args, \$1\$1kwargs)
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-apply"></a>

通过调用转换类来应用转换，并返回结果。
+ `cls` – `self` 类对象。

## name(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-name"></a>

返回派生的转换类的名称。
+ `cls` – `self` 类对象。

## describeArgs(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeArgs"></a>
+ `cls` – `self` 类对象。

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

```
[
  {
    "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)
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeReturn"></a>
+ `cls` – `self` 类对象。

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

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

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

## describeTransform(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeTransform"></a>

返回一个描述转换的字符串。
+ `cls` – `self` 类对象。

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

## describeErrors(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-describeErrors"></a>
+ `cls` – `self` 类对象。

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

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

## describe(cls)
<a name="aws-glue-api-crawler-pyspark-transforms-GlueTransform-describe"></a>
+ `cls` – `self` 类对象。

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

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