注: 以下の翻訳の正確性は検証されていません。AIPを利用して英語版の原文から機械的に翻訳されたものです。
| クラス | 説明 |
|---|---|
Check | Expectation をラップして Data Health に登録できるようにします。 |
FileStatus | FoundryFS ファイルの詳細をキャプチャする collections.namedtuple。 |
FileSystem(foundry_fs[, read_only]) | データセットファイルを読み書きするためのファイルシステムオブジェクト。 |
IncrementalTransformContext(ctx, is_incremental) | 増分計算用の機能が追加された TransformContext。 |
IncrementalTransformInput(tinput[, prev_txrid]) | 増分計算用の機能が追加された TransformInput。 |
IncrementalTransformOutput(toutput[, …]) | 増分計算用の機能が追加された TransformOutput。 |
Input(alias) | トランスフォーム入力の仕様。 |
Output(alias[, sever_permissions]) | トランスフォーム出力の仕様。 |
Pipeline() | トランスフォームオブジェクトのコレクションをグループ化するオブジェクト。 |
Transform(compute_func[, inputs, outputs, ...]) | 計算の単一ステップを記述する呼び出し可能なオブジェクト。 |
TransformContext(foundry_connector[, parameters])` | トランスフォームの計算関数にオプションで注入できるコンテキストオブジェクト。 |
TransformInput(rid, branch, txrange, …) | 実行時に Transform オブジェクトに渡される入力オブジェクト。 |
LightweightInput(alias) | 実行時に Lightweight Transform オブジェクトに渡される入力オブジェクト。 |
IncrementalLightweightInput(alias) | 実行時に増分 Lightweight Transform オブジェクトに渡される入力オブジェクト。 |
TransformOutput(rid, branch, txrid, …) | 実行時に Transform オブジェクトに渡される出力オブジェクト。 |
LightweightOutput\(alias) | 実行時に Lightweight Transform オブジェクトに渡される入力オブジェクト。 |
Checktransforms.api.CheckExpectation をラップして Data Health に登録できるようにします。
expectation
name
is_incremental
on_error
description
FileStatusclass transforms.api.FileStatus
FoundryFS ファイルの詳細をキャプチャする collections.namedtuple。
新しい FileStatus(path, size, modified) インスタンスを作成します。
count(value) → integer -- value の出現回数を返します。index(value[, start[, stop]]) → integer -- value の最初のインデックスを返します。
modified
path
size
FileSystemclass transforms.api.FileSystem(foundry_fs, read_only=False)
データセットファイルを読み書きするためのファイルシステムオブジェクト。
files(glob=None, regex='.*', show_hidden=False, packing_heuristic=None)
DataFrame ↗ を作成します。DataFrame ↗ はファイルサイズによってパーティション分けされ、各パーティションには spark.files.maxPartitionBytes バイト以下のサイズのファイルパスが含まれます。ファイルサイズが spark.files.maxPartitionBytes を超える場合は単一ファイルがパーティションに含まれます。ファイルのサイズはディスク上のファイルサイズに spark.files.openCostInBytes を加えたものとして計算されます。**/*.pdf を使用します。. や _ が付いたファイル。ffd (First Fit Decreasing) または wfd (Worst Fit Decreasing) です。wfd は分布が不均一になる傾向がありますが、非常に高速なので、大量のファイルを含むデータセットには wfd を推奨します。ヒューリスティックが指定されていない場合は、自動的に選択されます。ls(glob=None, regex='.*', show_hidden=False)
FileStatus - 論理パス、ファイルサイズ (バイト)、修正タイムスタンプ (1970年1月1日UTCからのミリ秒)。open(_path, mode='r', kwargs)
kwargs はキーワード引数です。io.open() ↗ に渡されます。. や _ が付いたファイル。IncrementalTransformContexttransforms.api.IncrementalTransformContext(ctx, is_incremental)増分計算用の機能が追加された TransformContext。
auth_header
fallback_branches
is_incremental
parameters
spark_session
IncrementalTransformInputtransforms.api.IncrementalTransformInput(tinput, prev_txrid=None)増分計算用の機能が追加された TransformInput。
dataframe(mode='added')
pyspark.sql.DataFrame を返します。filesystem(mode='added')
pandas()
branch
path
rid
IncrementalTransformOutputclass transforms.api.IncrementalTransformOutput(toutput, prev_txrid=None, mode='replace')
増分計算用の機能が追加された TransformOutput。
abort()
dataframe(mode='current', schema=None)
ValueError ↗ - モード ‘previous’ 使用時にスキーマが渡されていない場合。filesystem(mode='current')
NotImplementedError ↗ – 現在サポートされていません。pandas(mode='current')
set_mode(mode)
データが書き込まれた後に書き込みモードを変更することはできません。
write_dataframe(df, partition_cols=None, bucket_cols=None, bucket_count=None, sort_by=None, output_format=None, options=None)
Copied!1 2 3 4 5 6 7 8# myprojectというモジュールをインポートする >>> import myproject # Pipelineクラスのインスタンスを作成する >>> p = Pipeline() # myproject内で定義されたデータ変換を探し出す >>> p.discover_transforms(myproject)
見つかった各モジュールはインポートされます。モジュールレベルでコードを実行することは避けてください。
transforms
Transformclass transforms.api.Transform(compute_func, inputs=None, outputs=None, profile=None)
計算の単一ステップを説明する呼び出し可能オブジェクトです。
トランスフォームは、いくつかの Input 仕様、いくつかの Output 仕様、および計算関数から構成されます。
提供されたデコレータを使用してトランスフォームオブジェクトを構築するのが一般的です: transform(), transform_df(), および transform_pandas()。
注: 元の計算関数はトランスフォームの __call__ メソッドを通じて公開されます。
パラメーター
compute(ctx=None, _kwargs_)**
Input 仕様にマッピングする辞書。kwarg はキーワード引数の略です。version
select A, B from foo; は SQL query select A, B from (select * from foo); と同じバージョンであるべきです。ValueError ↗ – 計算関数のオブジェクトハッシュの計算に失敗した場合TransformContextclass transforms.api.TransformContext(foundry_connector, parameters=None)
トランスフォームの計算関数にオプションで注入できるコンテキストオブジェクト。
auth_header
fallback_branches
parameters
spark_session
TransformInputclass transforms.api.TransformInput(rid, branch, txrange, dfreader, fsbuilder)
実行時にトランスフォームオブジェクトに渡される入力オブジェクト。
dataframe()
filesystem()
pandas()
branch
path
rid
column_descriptions
column_typeclasses
LightweightInputclass transforms.api.LightweightInput(alias)
その目的は、Foundry Data Sidecar に委任しつつ、さまざまなデータ形式のサポートを追加して TransformInput のAPIのサブセットを模倣することです。
dataframe()
pandas() の別名です。filesystem()
pandas()
arrow()
polars(lazy: Optional[bool]=False)
lazy パラメーターの値に基づいてデータセットを持つ polars.DataFrame ↗ または polars.LazyFrame ↗ を返します。path()
IncrementalLightweightInputclass transforms.api.IncrementalLightweightInput(alias)
その目的は、Foundry Data Sidecar に委任しつつ、さまざまなデータ形式のサポートを追加して IncrementalTransformInput のAPIのサブセットを模倣することです。LightweightInput のインクリメンタルな対応物です。
dataframe(mode)
pandas() の別名です。filesystem()
pandas()(mode)
arrow()(mode)
polars(lazy=False, mode)
lazy パラメーターの値に基づいてデータセットを持つ polars.DataFrame ↗ または polars.LazyFrame ↗ を返します。path(mode)
TransformOutputclass transforms.api.TransformOutput(rid, branch, txrid, dfreader, dfwriter, fsbuilder)
実行時にトランスフォームオブジェクトに渡される出力オブジェクト。
abort()
dataframe()
filesystem()
pandas()
set_mode(mode)
write_dataframe(df, partition_cols=None, bucket_cols=None, bucket_count=None, _