Instantiate the Transform component
transform = Transform(
examples=example_gen.outputs[‘examples’],
schema=schema_gen.outputs[‘schema’],
module_file=os.path.abspath(_cover_transform_module_file))
END CODE HERE
Run the component
context.run(transform, enable_cache=False)
…
File “/home/jovyan/work/cover_transform.py”, line 48
features_dict[_transformed_name(feature)] = tft.hash_strings with the param hash_buckets set to 10(data_col)
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File “/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py”, line 3437, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File “”, line 12, in
context.run(transform, enable_cache=False)
File “/opt/conda/lib/python3.8/site-packages/tfx/orchestration/experimental/interactive/interactive_context.py”, line 67, in run_if_ipython
return fn(*args, **kwargs)
File “/opt/conda/lib/python3.8/site-packages/tfx/orchestration/experimental/interactive/interactive_context.py”, line 182, in run
execution_id = launcher.launch().execution_id
File “/opt/conda/lib/python3.8/site-packages/tfx/orchestration/launcher/base_component_launcher.py”, line 202, in launch
self._run_executor(execution_decision.execution_id,
File “/opt/conda/lib/python3.8/site-packages/tfx/orchestration/launcher/in_process_component_launcher.py”, line 67, in _run_executor
executor.Do(input_dict, output_dict, exec_properties)
File “/opt/conda/lib/python3.8/site-packages/tfx/components/transform/executor.py”, line 417, in Do
self.Transform(label_inputs, label_outputs, status_file)
File “/opt/conda/lib/python3.8/site-packages/tfx/components/transform/executor.py”, line 847, in Transform
preprocessing_fn = self._GetPreprocessingFn(inputs, outputs)
File “/opt/conda/lib/python3.8/site-packages/tfx/components/transform/executor.py”, line 767, in _GetPreprocessingFn
fn = import_utils.import_func_from_source(
File “/opt/conda/lib/python3.8/site-packages/tfx/utils/import_utils.py”, line 67, in import_func_from_source
loader.exec_module(user_module)
File “”, line 779, in exec_module
File “”, line 916, in get_code
File “”, line 846, in source_to_code
File “”, line 219, in _call_with_frames_removed
File “/home/jovyan/work/cover_transform.py”, line 48
features_dict[_transformed_name(feature)] = tft.hash_strings with the param hash_buckets set to 10(data_col)
^
SyntaxError: invalid syntax