From 2b9fedb98dbb8884f4476def4ea61cbf059755c1 Mon Sep 17 00:00:00 2001 From: Tom Pham <54967380+TomPham97@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:50:47 +0100 Subject: [PATCH] Update parquet executor spec (#31) --- _posts/2020-09-13-tfx-data-ingestion.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_posts/2020-09-13-tfx-data-ingestion.md b/_posts/2020-09-13-tfx-data-ingestion.md index 85109e0..045b342 100644 --- a/_posts/2020-09-13-tfx-data-ingestion.md +++ b/_posts/2020-09-13-tfx-data-ingestion.md @@ -147,13 +147,13 @@ table = pa.Table.from_pandas(df) pq.write_table(table, 'parquet_data/creditcard.parquet') # Import generic file loader component and Parquet-specific executor -from tfx.components import FileBasedExampleGen +from tfx.components.example_gen.component import FileBasedExampleGen from tfx.components.example_gen.custom_executors import parquet_executor -from tfx.components.base.executor_spec import ExecutorClassSpec +from tfx.dsl.components.base.executor_spec import BeamExecutorSpec from tfx.utils.dsl_utils import external_input examples = external_input('parquet_data/') -executor_spec = ExecutorClassSpec(parquet_executor.Executor) +executor_spec = BeamExecutorSpec(parquet_executor.Executor) example_gen = FileBasedExampleGen(input_base=examples, custom_executor_spec=executor_spec) context.run(example_gen) @@ -356,4 +356,4 @@ input = example_gen_pb2.Input(splits=[ examples = external_input('data') example_gen = CsvExampleGen(input=examples, input_config=input) -``` \ No newline at end of file +```