Enable prism by default (where supported) #26666
2 errors, 56 fail, 74 skipped, 354 pass in 24m 4s
Annotations
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_run_inference_impl_keyed_mps_incrementing_multi_copy (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 14s]
Raw output
apache_beam.testing.util.BeamAssertException: Failed assert: [('abc', 1), ('abc', 1), ('abc', 1), ('abc', 1), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 4), ('abc', 4), ('abc', 4), ('abc', 4)] == [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 8), ('abc', 8), ('abc', 8), ('abc', 8)], unexpected elements [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 8), ('abc', 8), ('abc', 8), ('abc', 8)], missing elements [('abc', 1), ('abc', 1), ('abc', 1), ('abc', 1), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 4), ('abc', 4), ('abc', 4), ('abc', 4)] [while running 'assert:inferences/Match']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ...]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7acab04384c0>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [('abc', 1), ('abc', 1), ('abc', 1), ('abc', 1), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 4), ('abc', 4), ('abc', 4), ('abc', 4)] == [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 8), ('abc', 8), ('abc', 8), ('abc', 8)], unexpected elements [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 8), ('abc', 8), ('abc', 8), ('abc', 8)], missing elements [('abc', 1), ('abc', 1), ('abc', 1), ('abc', 1), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 4), ('abc', 4), ('abc', 4), ('abc', 4)]
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_run_inference_impl_keyed_mps_incrementing_multi_copy>
def test_run_inference_impl_keyed_mps_incrementing_multi_copy(self):
with TestPipeline() as pipeline:
examples = [1, 5, 3, 10, 1, 5, 3, 10, 1, 5, 3, 10, 1, 5, 3, 10]
keyed_examples = [('abc', example) for example in examples]
expected = [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
keyed_expected = [('abc', val) for val in expected]
pcoll = pipeline | 'start' >> beam.Create(keyed_examples)
actual = pcoll | base.RunInference(
base.KeyedModelHandler(
FakeModelHandler(
multi_process_shared=True,
max_copies=4,
incrementing=True,
max_batch_size=1)))
> assert_that(actual, equal_to(keyed_expected), label='assert:inferences')
apache_beam/ml/inference/base_test.py:376:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/test_pipeline.py:115: in run
result = super().run(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:591: in run
return Pipeline.from_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ...]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7acab04384c0>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [('abc', 1), ('abc', 1), ('abc', 1), ('abc', 1), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 4), ('abc', 4), ('abc', 4), ('abc', 4)] == [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 8), ('abc', 8), ('abc', 8), ('abc', 8)], unexpected elements [('abc', 5), ('abc', 5), ('abc', 5), ('abc', 5), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 6), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 7), ('abc', 8), ('abc', 8), ('abc', 8), ('abc', 8)], missing elements [('abc', 1), ('abc', 1), ('abc', 1), ('abc', 1), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 2), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 3), ('abc', 4), ('abc', 4), ('abc', 4), ('abc', 4)] [while running 'assert:inferences/Match']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_counted_metrics (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 10s]
Raw output
AssertionError: [] is not true
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_counted_metrics>
def test_counted_metrics(self):
pipeline = TestPipeline()
examples = [1, 5, 3, 10]
pcoll = pipeline | 'start' >> beam.Create(examples)
_ = pcoll | base.RunInference(FakeModelHandler())
run_result = pipeline.run()
run_result.wait_until_finish()
metric_results = (
run_result.metrics().query(MetricsFilter().with_name('num_inferences')))
num_inferences_counter = metric_results['counters'][0]
self.assertEqual(num_inferences_counter.committed, 4)
inference_request_batch_size = run_result.metrics().query(
MetricsFilter().with_name('inference_request_batch_size'))
self.assertTrue(inference_request_batch_size['distributions'])
self.assertEqual(
inference_request_batch_size['distributions'][0].result.sum, 4)
inference_request_batch_byte_size = run_result.metrics().query(
MetricsFilter().with_name('inference_request_batch_byte_size'))
self.assertTrue(inference_request_batch_byte_size['distributions'])
self.assertGreaterEqual(
inference_request_batch_byte_size['distributions'][0].result.sum,
len(pickle.dumps(examples)))
inference_request_batch_byte_size = run_result.metrics().query(
MetricsFilter().with_name('model_byte_size'))
> self.assertTrue(inference_request_batch_byte_size['distributions'])
E AssertionError: [] is not true
apache_beam/ml/inference/base_test.py:1011: AssertionError
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_runinference_loads_same_model_with_identifier_multi_process_shared (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 13s]
Raw output
apache_beam.testing.util.BeamAssertException: Failed assert: [4, 5, 6] == [10, 11, 12], unexpected elements [10, 11, 12], missing elements [4, 5, 6] [while running 'assert:inferences/Match']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [10, 11, 12]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7a1d506bd5e0>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [4, 5, 6] == [10, 11, 12], unexpected elements [10, 11, 12], missing elements [4, 5, 6]
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_runinference_loads_same_model_with_identifier_multi_process_shared>
def test_runinference_loads_same_model_with_identifier_multi_process_shared(
self):
mh1 = FakeModelHandler(
incrementing=True, min_batch_size=3, multi_process_shared=True)
with TestPipeline() as pipeline:
pcoll = pipeline | 'start' >> beam.Create([1, 2, 3])
actual = (
pcoll
| 'ri1' >> base.RunInference(
mh1,
model_identifier='same_model_with_identifier_multi_process_shared'
)
| 'ri2' >> base.RunInference(
mh1,
model_identifier='same_model_with_identifier_multi_process_shared'
))
> assert_that(actual, equal_to([4, 5, 6]), label='assert:inferences')
apache_beam/ml/inference/base_test.py:1761:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/test_pipeline.py:115: in run
result = super().run(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:591: in run
return Pipeline.from_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [10, 11, 12]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7a1d506bd5e0>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [4, 5, 6] == [10, 11, 12], unexpected elements [10, 11, 12], missing elements [4, 5, 6] [while running 'assert:inferences/Match']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_run_inference_impl_mps_nobatch_incrementing_multi_copy (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 13s]
Raw output
apache_beam.testing.util.BeamAssertException: Failed assert: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] == [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], unexpected elements [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], missing elements [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] [while running 'assert:inferences/Match']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [5, 5, 5, 5, 6, 6, ...]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7ac9489c3b80>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] == [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], unexpected elements [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], missing elements [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_run_inference_impl_mps_nobatch_incrementing_multi_copy>
def test_run_inference_impl_mps_nobatch_incrementing_multi_copy(self):
with TestPipeline() as pipeline:
examples = [1, 5, 3, 10, 1, 5, 3, 10, 1, 5, 3, 10, 1, 5, 3, 10]
expected = [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
batched_examples = [[example] for example in examples]
pcoll = pipeline | 'start' >> beam.Create(batched_examples)
actual = pcoll | base.RunInference(
FakeModelHandler(
multi_process_shared=True, max_copies=4,
incrementing=True).with_no_batching())
> assert_that(actual, equal_to(expected), label='assert:inferences')
apache_beam/ml/inference/base_test.py:360:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/test_pipeline.py:115: in run
result = super().run(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:591: in run
return Pipeline.from_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [5, 5, 5, 5, 6, 6, ...]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7ac9489c3b80>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] == [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], unexpected elements [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], missing elements [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] [while running 'assert:inferences/Match']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_run_inference_impl_multi_process_shared_incrementing_multi_copy (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 15s]
Raw output
apache_beam.testing.util.BeamAssertException: Failed assert: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] == [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], unexpected elements [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], missing elements [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] [while running 'assert:inferences/Match']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [5, 5, 5, 5, 6, 6, ...]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7acab06698b0>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] == [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], unexpected elements [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], missing elements [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_run_inference_impl_multi_process_shared_incrementing_multi_copy>
def test_run_inference_impl_multi_process_shared_incrementing_multi_copy(
self):
with TestPipeline() as pipeline:
examples = [1, 5, 3, 10, 1, 5, 3, 10, 1, 5, 3, 10, 1, 5, 3, 10]
expected = [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
pcoll = pipeline | 'start' >> beam.Create(examples)
actual = pcoll | base.RunInference(
FakeModelHandler(
multi_process_shared=True,
max_copies=4,
incrementing=True,
max_batch_size=1))
> assert_that(actual, equal_to(expected), label='assert:inferences')
apache_beam/ml/inference/base_test.py:348:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/test_pipeline.py:115: in run
result = super().run(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:591: in run
return Pipeline.from_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [5, 5, 5, 5, 6, 6, ...]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7acab06698b0>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] == [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], unexpected elements [5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8], missing elements [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] [while running 'assert:inferences/Match']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_run_inference_impl_with_keyed_examples_many_mhs_max_models_hint (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 12s]
Raw output
AssertionError: 1 not greater than 2
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_run_inference_impl_with_keyed_examples_many_mhs_max_models_hint>
def test_run_inference_impl_with_keyed_examples_many_mhs_max_models_hint(
self):
pipeline = TestPipeline()
examples = [1, 5, 3, 10, 2, 4, 6, 8, 9, 7, 1, 5, 3, 10, 2, 4, 6, 8, 9, 7]
metrics_namespace = 'test_namespace'
keyed_examples = [(i, example) for i, example in enumerate(examples)]
pcoll = pipeline | 'start' >> beam.Create(keyed_examples)
mhs = [
base.KeyModelMapping([0, 2, 4, 6, 8],
FakeModelHandler(
state=200, multi_process_shared=True)),
base.KeyModelMapping(
[1, 3, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
FakeModelHandler(multi_process_shared=True))
]
_ = pcoll | base.RunInference(
base.KeyedModelHandler(mhs, max_models_per_worker_hint=1),
metrics_namespace=metrics_namespace)
result = pipeline.run()
result.wait_until_finish()
metrics_filter = MetricsFilter().with_namespace(namespace=metrics_namespace)
metrics = result.metrics().query(metrics_filter)
assert len(metrics['counters']) != 0
assert len(metrics['distributions']) != 0
metrics_filter = MetricsFilter().with_name('load_model_latency_milli_secs')
metrics = result.metrics().query(metrics_filter)
load_latency_dist_aggregate = metrics['distributions'][0]
# We should flip back and forth between models a bit since
# max_models_per_worker_hint=1, but we shouldn't thrash forever
# since most examples belong to the second ModelMapping
> self.assertGreater(load_latency_dist_aggregate.committed.count, 2)
E AssertionError: 1 not greater than 2
apache_beam/ml/inference/base_test.py:497: AssertionError
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_run_inference_impl_with_keyed_examples_many_model_handlers_metrics (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 11s]
Raw output
IndexError: list index out of range
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_run_inference_impl_with_keyed_examples_many_model_handlers_metrics>
def test_run_inference_impl_with_keyed_examples_many_model_handlers_metrics(
self):
pipeline = TestPipeline()
examples = [1, 5, 3, 10]
metrics_namespace = 'test_namespace'
keyed_examples = [(i, example) for i, example in enumerate(examples)]
pcoll = pipeline | 'start' >> beam.Create(keyed_examples)
mhs = [
base.KeyModelMapping([0],
FakeModelHandler(
state=200, multi_process_shared=True)),
base.KeyModelMapping([1, 2, 3],
FakeModelHandler(multi_process_shared=True))
]
_ = pcoll | base.RunInference(
base.KeyedModelHandler(mhs), metrics_namespace=metrics_namespace)
result = pipeline.run()
result.wait_until_finish()
metrics_filter = MetricsFilter().with_namespace(namespace=metrics_namespace)
metrics = result.metrics().query(metrics_filter)
assert len(metrics['counters']) != 0
assert len(metrics['distributions']) != 0
metrics_filter = MetricsFilter().with_name('0-_num_inferences')
metrics = result.metrics().query(metrics_filter)
num_inferences_counter_key_0 = metrics['counters'][0]
self.assertEqual(num_inferences_counter_key_0.committed, 1)
metrics_filter = MetricsFilter().with_name('1-_num_inferences')
metrics = result.metrics().query(metrics_filter)
num_inferences_counter_key_1 = metrics['counters'][0]
self.assertEqual(num_inferences_counter_key_1.committed, 3)
metrics_filter = MetricsFilter().with_name('num_inferences')
metrics = result.metrics().query(metrics_filter)
num_inferences_counter_aggregate = metrics['counters'][0]
self.assertEqual(num_inferences_counter_aggregate.committed, 4)
metrics_filter = MetricsFilter().with_name('0-_failed_batches_counter')
metrics = result.metrics().query(metrics_filter)
failed_batches_counter_key_0 = metrics['counters']
self.assertEqual(len(failed_batches_counter_key_0), 0)
metrics_filter = MetricsFilter().with_name('failed_batches_counter')
metrics = result.metrics().query(metrics_filter)
failed_batches_counter_aggregate = metrics['counters']
self.assertEqual(len(failed_batches_counter_aggregate), 0)
metrics_filter = MetricsFilter().with_name(
'0-_load_model_latency_milli_secs')
metrics = result.metrics().query(metrics_filter)
> load_latency_dist_key_0 = metrics['distributions'][0]
E IndexError: list index out of range
apache_beam/ml/inference/base_test.py:457: IndexError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transform_on_list_dict (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 31s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba46c70e880>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpess2vptp/f8c83f/tftransform_tmp/4fc5bb338ef64f32930c063a131e7825'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transform_on_list_dict>
@unittest.skipIf(tft is None, 'tft module is not installed.')
def test_ml_transform_on_list_dict(self):
transforms = [tft.ScaleTo01(columns=['x'])]
data = [{'x': [1, 2, 3]}, {'x': [4, 5, 6]}]
with beam.Pipeline() as p:
result = (
p
| beam.Create(data)
| base.MLTransform(
transforms=transforms,
write_artifact_location=self.artifact_location))
expected_output = [
np.array([0, 0.2, 0.4], dtype=np.float32),
np.array([0.6, 0.8, 1], dtype=np.float32),
]
actual_output = result | beam.Map(lambda x: x.x)
> assert_that(
actual_output, equal_to(expected_output, equals_fn=np.array_equal))
apache_beam/ml/transforms/base_test.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba46c70e880>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpess2vptp/f8c83f/tftransform_tmp/4fc5bb338ef64f32930c063a131e7825'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.inference.base_test.RunInferenceBaseTest
github-actions / Test Results
test_run_inference_loads_different_models_multi_process_shared (apache_beam.ml.inference.base_test.RunInferenceBaseTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 14s]
Raw output
apache_beam.testing.util.BeamAssertException: Failed assert: [1, 2, 3] == [4, 5, 6], unexpected elements [4, 5, 6], missing elements [1, 2, 3] [while running 'assert:inferences/Match']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [4, 5, 6]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7ac93c1fe040>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [1, 2, 3] == [4, 5, 6], unexpected elements [4, 5, 6], missing elements [1, 2, 3]
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.inference.base_test.RunInferenceBaseTest testMethod=test_run_inference_loads_different_models_multi_process_shared>
def test_run_inference_loads_different_models_multi_process_shared(self):
mh1 = FakeModelHandler(
incrementing=True, min_batch_size=3, multi_process_shared=True)
with TestPipeline() as pipeline:
pcoll = pipeline | 'start' >> beam.Create([1, 2, 3])
actual = (
pcoll
| 'ri1' >> base.RunInference(mh1)
| 'ri2' >> base.RunInference(mh1))
> assert_that(actual, equal_to([1, 2, 3]), label='assert:inferences')
apache_beam/ml/inference/base_test.py:1743:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/test_pipeline.py:115: in run
result = super().run(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:591: in run
return Pipeline.from_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1055: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [4, 5, 6]
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x7ac93c1fe040>
def _equal(actual, equals_fn=equals_fn):
expected_list = list(expected)
# Try to compare actual and expected by sorting. This fails with a
# TypeError in Python 3 if different types are present in the same
# collection. It can also raise false negatives for types that don't have
# a deterministic sort order, like pyarrow Tables as of 0.14.1
if not equals_fn:
equals_fn = lambda e, a: e == a
try:
sorted_expected = sorted(expected)
sorted_actual = sorted(actual)
if sorted_expected == sorted_actual:
return
except TypeError:
pass
# Slower method, used in two cases:
# 1) If sorted expected != actual, use this method to verify the inequality.
# This ensures we don't raise any false negatives for types that don't
# have a deterministic sort order.
# 2) As a fallback if we encounter a TypeError in python 3. this method
# works on collections that have different types.
unexpected = []
for element in actual:
found = False
for i, v in enumerate(expected_list):
if equals_fn(v, element):
found = True
expected_list.pop(i)
break
if not found:
unexpected.append(element)
if unexpected or expected_list:
msg = 'Failed assert: %r == %r' % (expected, actual)
if unexpected:
msg = msg + ', unexpected elements %r' % unexpected
if expected_list:
msg = msg + ', missing elements %r' % expected_list
> raise BeamAssertException(msg)
E apache_beam.testing.util.BeamAssertException: Failed assert: [1, 2, 3] == [4, 5, 6], unexpected elements [4, 5, 6], missing elements [1, 2, 3] [while running 'assert:inferences/Match']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/testing/util.py:192: BeamAssertException
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transform_dict_output_pcoll_schema_0 (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 29s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b79e85970a0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpk_gde9c6/8ec42c/tftransform_tmp/23ab8c7d9239496e86dc5550a1a3fff6'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
a = (<apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transform_dict_output_pcoll_schema_0>,)
kw = {}
@wraps(func)
def standalone_func(*a, **kw):
> return func(*(a + p.args), **p.kwargs, **kw)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/parameterized/parameterized.py:620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/ml/transforms/base_test.py:204: in test_ml_transform_dict_output_pcoll_schema
self.assertEqual(expected_dtype[name], typ)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1282: in process_bundle
op.finish()
apache_beam/runners/worker/operations.py:981: in apache_beam.runners.worker.operations.DoOperation.finish
def finish(self):
apache_beam/runners/worker/operations.py:984: in apache_beam.runners.worker.operations.DoOperation.finish
with self.scoped_finish_state:
apache_beam/runners/worker/operations.py:985: in apache_beam.runners.worker.operations.DoOperation.finish
self.dofn_runner.finish()
apache_beam/runners/common.py:1573: in apache_beam.runners.common.DoFnRunner.finish
self._invoke_bundle_method(self.do_fn_invoker.invoke_finish_bundle)
apache_beam/runners/common.py:1554: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
self._reraise_augmented(exn)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1552: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
bundle_method()
apache_beam/runners/common.py:615: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
def invoke_finish_bundle(self):
apache_beam/runners/common.py:620: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
self.output_handler.finish_bundle_outputs(
apache_beam/runners/common.py:1844: in apache_beam.runners.common._OutputHandler.finish_bundle_outputs
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b79e85970a0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpk_gde9c6/8ec42c/tftransform_tmp/23ab8c7d9239496e86dc5550a1a3fff6'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transform_on_multiple_columns_single_transform (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 28s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba639e48ca0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmp16htm2x9/de9291/tftransform_tmp/c22c374409394d77872b6117bf1d857c'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transform_on_multiple_columns_single_transform>
@unittest.skipIf(tft is None, 'tft module is not installed.')
def test_ml_transform_on_multiple_columns_single_transform(self):
transforms = [tft.ScaleTo01(columns=['x', 'y'])]
data = [{'x': [1, 2, 3], 'y': [1.0, 10.0, 20.0]}]
with beam.Pipeline() as p:
result = (
p
| beam.Create(data)
| base.MLTransform(
transforms=transforms,
write_artifact_location=self.artifact_location))
expected_output_x = [
np.array([0, 0.5, 1], dtype=np.float32),
]
expected_output_y = [np.array([0, 0.47368422, 1], dtype=np.float32)]
actual_output_x = result | beam.Map(lambda x: x.x)
actual_output_y = result | beam.Map(lambda x: x.y)
assert_that(
actual_output_x,
equal_to(expected_output_x, equals_fn=np.array_equal))
> assert_that(
actual_output_y,
equal_to(expected_output_y, equals_fn=np.array_equal),
label='y')
apache_beam/ml/transforms/base_test.py:242:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1282: in process_bundle
op.finish()
apache_beam/runners/worker/operations.py:981: in apache_beam.runners.worker.operations.DoOperation.finish
def finish(self):
apache_beam/runners/worker/operations.py:984: in apache_beam.runners.worker.operations.DoOperation.finish
with self.scoped_finish_state:
apache_beam/runners/worker/operations.py:985: in apache_beam.runners.worker.operations.DoOperation.finish
self.dofn_runner.finish()
apache_beam/runners/common.py:1573: in apache_beam.runners.common.DoFnRunner.finish
self._invoke_bundle_method(self.do_fn_invoker.invoke_finish_bundle)
apache_beam/runners/common.py:1554: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
self._reraise_augmented(exn)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1552: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
bundle_method()
apache_beam/runners/common.py:615: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
def invoke_finish_bundle(self):
apache_beam/runners/common.py:620: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
self.output_handler.finish_bundle_outputs(
apache_beam/runners/common.py:1844: in apache_beam.runners.common._OutputHandler.finish_bundle_outputs
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba639e48ca0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmp16htm2x9/de9291/tftransform_tmp/c22c374409394d77872b6117bf1d857c'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transform_dict_output_pcoll_schema_1 (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 24s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b7a8803f640>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmph9hqg5ml/1bbb79/tftransform_tmp/6a03035416ac403eac5fd068ef92be2d'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
a = (<apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transform_dict_output_pcoll_schema_1>,)
kw = {}
@wraps(func)
def standalone_func(*a, **kw):
> return func(*(a + p.args), **p.kwargs, **kw)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/parameterized/parameterized.py:620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/ml/transforms/base_test.py:204: in test_ml_transform_dict_output_pcoll_schema
self.assertEqual(expected_dtype[name], typ)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1282: in process_bundle
op.finish()
apache_beam/runners/worker/operations.py:981: in apache_beam.runners.worker.operations.DoOperation.finish
def finish(self):
apache_beam/runners/worker/operations.py:984: in apache_beam.runners.worker.operations.DoOperation.finish
with self.scoped_finish_state:
apache_beam/runners/worker/operations.py:985: in apache_beam.runners.worker.operations.DoOperation.finish
self.dofn_runner.finish()
apache_beam/runners/common.py:1573: in apache_beam.runners.common.DoFnRunner.finish
self._invoke_bundle_method(self.do_fn_invoker.invoke_finish_bundle)
apache_beam/runners/common.py:1554: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
self._reraise_augmented(exn)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1552: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
bundle_method()
apache_beam/runners/common.py:615: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
def invoke_finish_bundle(self):
apache_beam/runners/common.py:620: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
self.output_handler.finish_bundle_outputs(
apache_beam/runners/common.py:1844: in apache_beam.runners.common._OutputHandler.finish_bundle_outputs
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b7a8803f640>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmph9hqg5ml/1bbb79/tftransform_tmp/6a03035416ac403eac5fd068ef92be2d'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest
github-actions / Test Results
1 out of 2 runs failed: test_consume_mode_with_extra_columns_in_the_input (apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest)
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 1m 0s]
Raw output
RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7c719c73ef10>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmp7g3hrdy9/tftransform_tmp/7d1b380c82794cd88cbffab444bfcf4a'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest testMethod=test_consume_mode_with_extra_columns_in_the_input>
def test_consume_mode_with_extra_columns_in_the_input(self):
with beam.Pipeline() as p:
raw_data = (
p
| beam.Create([{
'x': np.array([1, 3])
}, {
'x': np.array([4, 6])
}]))
process_handler = handlers.TFTProcessHandler(
transforms=[tft.ScaleTo01(columns=['x'])],
artifact_location=self.artifact_location,
)
> _ = raw_data | process_handler
apache_beam/ml/transforms/handlers_test.py:527:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7c719c73ef10>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmp7g3hrdy9/tftransform_tmp/7d1b380c82794cd88cbffab444bfcf4a'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check failure on line 0 in apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest
github-actions / Test Results
1 out of 2 runs with error: test_consume_mode_with_extra_columns_in_the_input (apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest)
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 0s]
Raw output
failed on teardown with "OSError: [Errno 39] Directory not empty: 'tftransform_tmp'"
self = <apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest testMethod=test_consume_mode_with_extra_columns_in_the_input>
def tearDown(self):
> shutil.rmtree(self.artifact_location)
apache_beam/ml/transforms/handlers_test.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/shutil.py:734: in rmtree
_rmtree_safe_fd(fd, path, onerror)
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/shutil.py:673: in _rmtree_safe_fd
onerror(os.rmdir, fullname, sys.exc_info())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
topfd = 22, path = '/tmp/tmp7g3hrdy9'
onerror = <function rmtree.<locals>.onerror at 0x7c71181498b0>
def _rmtree_safe_fd(topfd, path, onerror):
try:
with os.scandir(topfd) as scandir_it:
entries = list(scandir_it)
except OSError as err:
err.filename = path
onerror(os.scandir, path, sys.exc_info())
return
for entry in entries:
fullname = os.path.join(path, entry.name)
try:
is_dir = entry.is_dir(follow_symlinks=False)
except OSError:
is_dir = False
else:
if is_dir:
try:
orig_st = entry.stat(follow_symlinks=False)
is_dir = stat.S_ISDIR(orig_st.st_mode)
except OSError:
onerror(os.lstat, fullname, sys.exc_info())
continue
if is_dir:
try:
dirfd = os.open(entry.name, os.O_RDONLY, dir_fd=topfd)
dirfd_closed = False
except OSError:
onerror(os.open, fullname, sys.exc_info())
else:
try:
if os.path.samestat(orig_st, os.fstat(dirfd)):
_rmtree_safe_fd(dirfd, fullname, onerror)
try:
os.close(dirfd)
dirfd_closed = True
> os.rmdir(entry.name, dir_fd=topfd)
E OSError: [Errno 39] Directory not empty: 'tftransform_tmp'
/opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/shutil.py:671: OSError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transforms_on_multiple_columns_multiple_transforms (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 1m 21s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba63a099640>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
y: large_list<item: large_binary>
child 0, item: large_binary
saved_model_dir = '/tmp/tmp8opskph1/00ad55/tftransform_tmp/ae4867d07f0b4c588f281715da53191c'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transforms_on_multiple_columns_multiple_transforms>
@unittest.skipIf(tft is None, 'tft module is not installed.')
def test_ml_transforms_on_multiple_columns_multiple_transforms(self):
transforms = [
tft.ScaleTo01(columns=['x']),
tft.ComputeAndApplyVocabulary(columns=['y'])
]
data = [{'x': [1, 2, 3], 'y': ['a', 'b', 'c']}]
with beam.Pipeline() as p:
result = (
p
| beam.Create(data)
| base.MLTransform(
transforms=transforms,
write_artifact_location=self.artifact_location))
expected_output_x = [
np.array([0, 0.5, 1], dtype=np.float32),
]
expected_output_y = [np.array([2, 1, 0])]
actual_output_x = result | beam.Map(lambda x: x.x)
actual_output_y = result | beam.Map(lambda x: x.y)
assert_that(
actual_output_x,
equal_to(expected_output_x, equals_fn=np.array_equal))
> assert_that(
actual_output_y,
equal_to(expected_output_y, equals_fn=np.array_equal),
label='actual_output_y')
apache_beam/ml/transforms/base_test.py:271:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1282: in process_bundle
op.finish()
apache_beam/runners/worker/operations.py:981: in apache_beam.runners.worker.operations.DoOperation.finish
def finish(self):
apache_beam/runners/worker/operations.py:984: in apache_beam.runners.worker.operations.DoOperation.finish
with self.scoped_finish_state:
apache_beam/runners/worker/operations.py:985: in apache_beam.runners.worker.operations.DoOperation.finish
self.dofn_runner.finish()
apache_beam/runners/common.py:1573: in apache_beam.runners.common.DoFnRunner.finish
self._invoke_bundle_method(self.do_fn_invoker.invoke_finish_bundle)
apache_beam/runners/common.py:1554: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
self._reraise_augmented(exn)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1552: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
bundle_method()
apache_beam/runners/common.py:615: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
def invoke_finish_bundle(self):
apache_beam/runners/common.py:620: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
self.output_handler.finish_bundle_outputs(
apache_beam/runners/common.py:1844: in apache_beam.runners.common._OutputHandler.finish_bundle_outputs
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba63a099640>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
y: large_list<item: large_binary>
child 0, item: large_binary
saved_model_dir = '/tmp/tmp8opskph1/00ad55/tftransform_tmp/ae4867d07f0b4c588f281715da53191c'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transform_dict_output_pcoll_schema_2 (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 1m 8s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b7c4cd566d0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpdirgn_yf/e69497/tftransform_tmp/02129cdfbd264bfa94f51ce3e4550371'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
a = (<apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transform_dict_output_pcoll_schema_2>,)
kw = {}
@wraps(func)
def standalone_func(*a, **kw):
> return func(*(a + p.args), **p.kwargs, **kw)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/parameterized/parameterized.py:620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/ml/transforms/base_test.py:204: in test_ml_transform_dict_output_pcoll_schema
self.assertEqual(expected_dtype[name], typ)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1282: in process_bundle
op.finish()
apache_beam/runners/worker/operations.py:981: in apache_beam.runners.worker.operations.DoOperation.finish
def finish(self):
apache_beam/runners/worker/operations.py:984: in apache_beam.runners.worker.operations.DoOperation.finish
with self.scoped_finish_state:
apache_beam/runners/worker/operations.py:985: in apache_beam.runners.worker.operations.DoOperation.finish
self.dofn_runner.finish()
apache_beam/runners/common.py:1573: in apache_beam.runners.common.DoFnRunner.finish
self._invoke_bundle_method(self.do_fn_invoker.invoke_finish_bundle)
apache_beam/runners/common.py:1554: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
self._reraise_augmented(exn)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1552: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
bundle_method()
apache_beam/runners/common.py:615: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
def invoke_finish_bundle(self):
apache_beam/runners/common.py:620: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
self.output_handler.finish_bundle_outputs(
apache_beam/runners/common.py:1844: in apache_beam.runners.common._OutputHandler.finish_bundle_outputs
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b7c4cd566d0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpdirgn_yf/e69497/tftransform_tmp/02129cdfbd264bfa94f51ce3e4550371'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest
github-actions / Test Results
test_tft_process_handler_unused_column (apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 1m 4s]
Raw output
RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7acab096f9d0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpar5dnqng/tftransform_tmp/abb8c35ac471406e8b4213bf95cc8dc3'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest testMethod=test_tft_process_handler_unused_column>
def test_tft_process_handler_unused_column(self):
data = [
{
'x': [5, 1], 'y': 2
},
{
'x': [8, 4], 'y': 5
},
{
'x': [9, 5], 'y': 6
},
{
'x': [10, 6], 'y': 7
},
{
'x': [11, 7], 'y': 8
},
{
'x': [12, 8], 'y': 9
},
{
'x': [13, 9], 'y': 10
},
{
'x': [14, 10], 'y': 11
},
{
'x': [15, 11], 'y': 12
},
{
'x': [16, 12], 'y': 13
},
{
'x': [17, 13], 'y': 14
},
{
'x': [18, 14], 'y': 15
},
{
'x': [19, 15], 'y': 16
},
{
'x': [20, 16], 'y': 17
},
{
'x': [21, 17], 'y': 18
},
{
'x': [22, 18], 'y': 19
},
{
'x': [23, 19], 'y': 20
},
{
'x': [24, 20], 'y': 21
},
{
'x': [25, 21], 'y': 22
},
]
# pylint: disable=line-too-long
expected_data = [
beam.Row(
x=np.array([0.16666667, 0.], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=2),
beam.Row(
x=np.array([0.29166666, 0.125], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=5),
beam.Row(
x=np.array([0.33333334, 0.16666667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=6),
beam.Row(
x=np.array([0.375, 0.20833333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=7),
beam.Row(
x=np.array([0.41666666, 0.25], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=8),
beam.Row(
x=np.array([0.45833334, 0.29166666], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=9),
beam.Row(
x=np.array([0.5, 0.33333334], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=10),
beam.Row(
x=np.array([0.5416667, 0.375], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=11),
beam.Row(
x=np.array([0.5833333, 0.41666666], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=12),
beam.Row(
x=np.array([0.625, 0.45833334], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=13),
beam.Row(
x=np.array([0.6666667, 0.5], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=14),
beam.Row(
x=np.array([0.7083333, 0.5416667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=15),
beam.Row(
x=np.array([0.75, 0.5833333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=16),
beam.Row(
x=np.array([0.7916667, 0.625], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=17),
beam.Row(
x=np.array([0.8333333, 0.6666667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=18),
beam.Row(
x=np.array([0.875, 0.7083333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=19),
beam.Row(
x=np.array([0.9166667, 0.75], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=20),
beam.Row(
x=np.array([0.9583333, 0.7916667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=21),
beam.Row(
x=np.array([1., 0.8333333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=22),
]
# pylint: enable=line-too-long
expected_data_x = [row.x for row in expected_data]
expected_data_y = [row.y for row in expected_data]
scale_to_0_1_fn = tft.ScaleTo01(columns=['x'])
with beam.Pipeline() as p:
raw_data = p | beam.Create(data)
process_handler = handlers.TFTProcessHandler(
transforms=[scale_to_0_1_fn],
artifact_location=self.artifact_location,
)
transformed_pcoll = raw_data | process_handler
transformed_pcoll_x = transformed_pcoll | beam.Map(lambda x: x.x)
transformed_pcoll_y = transformed_pcoll | beam.Map(lambda x: x.y)
assert_that(
transformed_pcoll_x,
equal_to(expected_data_x, equals_fn=np.array_equal),
label='transformed data')
> assert_that(
transformed_pcoll_y,
equal_to(expected_data_y, equals_fn=np.array_equal),
label='unused column')
apache_beam/ml/transforms/handlers_test.py:509:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7acab096f9d0>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpar5dnqng/tftransform_tmp/abb8c35ac471406e8b4213bf95cc8dc3'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transform_dict_output_pcoll_schema_3 (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 23s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b79b84fe910>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpa22nmvez/20b5ba/tftransform_tmp/285a2589a63d4acf9dcfa27e4df611f9'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
a = (<apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transform_dict_output_pcoll_schema_3>,)
kw = {}
@wraps(func)
def standalone_func(*a, **kw):
> return func(*(a + p.args), **p.kwargs, **kw)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/parameterized/parameterized.py:620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/ml/transforms/base_test.py:204: in test_ml_transform_dict_output_pcoll_schema
self.assertEqual(expected_dtype[name], typ)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1282: in process_bundle
op.finish()
apache_beam/runners/worker/operations.py:981: in apache_beam.runners.worker.operations.DoOperation.finish
def finish(self):
apache_beam/runners/worker/operations.py:984: in apache_beam.runners.worker.operations.DoOperation.finish
with self.scoped_finish_state:
apache_beam/runners/worker/operations.py:985: in apache_beam.runners.worker.operations.DoOperation.finish
self.dofn_runner.finish()
apache_beam/runners/common.py:1573: in apache_beam.runners.common.DoFnRunner.finish
self._invoke_bundle_method(self.do_fn_invoker.invoke_finish_bundle)
apache_beam/runners/common.py:1554: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
self._reraise_augmented(exn)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1552: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
bundle_method()
apache_beam/runners/common.py:615: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
def invoke_finish_bundle(self):
apache_beam/runners/common.py:620: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
self.output_handler.finish_bundle_outputs(
apache_beam/runners/common.py:1844: in apache_beam.runners.common._OutputHandler.finish_bundle_outputs
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b79b84fe910>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: int64>
child 0, item: int64
y: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpa22nmvez/20b5ba/tftransform_tmp/285a2589a63d4acf9dcfa27e4df611f9'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest
github-actions / Test Results
test_handler_with_same_input_elements (apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 26s]
Raw output
RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7c71ca91e400>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: large_binary>
child 0, item: large_binary
saved_model_dir = '/tmp/tmp_gy7aqbv/tftransform_tmp/822d940a561348ba937ffb152527ba0c'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest testMethod=test_handler_with_same_input_elements>
def test_handler_with_same_input_elements(self):
with beam.Pipeline() as p:
data = [
{
'x': 'I'
},
{
'x': 'love'
},
{
'x': 'Beam'
},
{
'x': 'Beam'
},
{
'x': 'is'
},
{
'x': 'awesome'
},
]
raw_data = (p | beam.Create(data))
process_handler = handlers.TFTProcessHandler(
transforms=[tft.ComputeAndApplyVocabulary(columns=['x'])],
artifact_location=self.artifact_location,
)
transformed_data = raw_data | process_handler
expected_data = [
beam.Row(x=np.array([4])),
beam.Row(x=np.array([1])),
beam.Row(x=np.array([0])),
beam.Row(x=np.array([0])),
beam.Row(x=np.array([2])),
beam.Row(x=np.array([3])),
]
expected_data_x = [row.x for row in expected_data]
actual_data_x = transformed_data | beam.Map(lambda x: x.x)
> assert_that(
actual_data_x,
equal_to(expected_data_x, equals_fn=np.array_equal),
label='transformed data')
apache_beam/ml/transforms/handlers_test.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7c71ca91e400>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: large_binary>
child 0, item: large_binary
saved_model_dir = '/tmp/tmp_gy7aqbv/tftransform_tmp/822d940a561348ba937ffb152527ba0c'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_mltransform_with_counter (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 29s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba4d107d910>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
y: large_list<item: large_binary>
child 0, item: large_binary
saved_model_dir = '/tmp/tmp0vlg2d7r/4b2c84/tftransform_tmp/ee2f3e9ec7664158a11ae43b82b7fd6e'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_mltransform_with_counter>
@unittest.skipIf(tft is None, 'tft module is not installed.')
def test_mltransform_with_counter(self):
transforms = [
tft.ComputeAndApplyVocabulary(columns=['y']),
tft.ScaleTo01(columns=['x'])
]
data = [{'x': [1, 2, 3], 'y': ['a', 'b', 'c']}]
with beam.Pipeline() as p:
> _ = (
p | beam.Create(data)
| base.MLTransform(
transforms=transforms,
write_artifact_location=self.artifact_location))
apache_beam/ml/transforms/base_test.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1282: in process_bundle
op.finish()
apache_beam/runners/worker/operations.py:981: in apache_beam.runners.worker.operations.DoOperation.finish
def finish(self):
apache_beam/runners/worker/operations.py:984: in apache_beam.runners.worker.operations.DoOperation.finish
with self.scoped_finish_state:
apache_beam/runners/worker/operations.py:985: in apache_beam.runners.worker.operations.DoOperation.finish
self.dofn_runner.finish()
apache_beam/runners/common.py:1573: in apache_beam.runners.common.DoFnRunner.finish
self._invoke_bundle_method(self.do_fn_invoker.invoke_finish_bundle)
apache_beam/runners/common.py:1554: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
self._reraise_augmented(exn)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1552: in apache_beam.runners.common.DoFnRunner._invoke_bundle_method
bundle_method()
apache_beam/runners/common.py:615: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
def invoke_finish_bundle(self):
apache_beam/runners/common.py:620: in apache_beam.runners.common.DoFnInvoker.invoke_finish_bundle
self.output_handler.finish_bundle_outputs(
apache_beam/runners/common.py:1844: in apache_beam.runners.common._OutputHandler.finish_bundle_outputs
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ba4d107d910>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
y: large_list<item: large_binary>
child 0, item: large_binary
saved_model_dir = '/tmp/tmp0vlg2d7r/4b2c84/tftransform_tmp/ee2f3e9ec7664158a11ae43b82b7fd6e'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest
github-actions / Test Results
test_tft_process_handler_verify_artifacts (apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 22s]
Raw output
RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ac92c746460>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpqt6gvlik/tftransform_tmp/3cc5ed1baad74005a543dd954882533b'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTest testMethod=test_tft_process_handler_verify_artifacts>
def test_tft_process_handler_verify_artifacts(self):
with beam.Pipeline() as p:
raw_data = (
p
| beam.Create([{
'x': np.array([1, 3])
}, {
'x': np.array([4, 6])
}]))
process_handler = handlers.TFTProcessHandler(
transforms=[tft.ScaleTo01(columns=['x'])],
artifact_location=self.artifact_location,
)
_ = raw_data | process_handler
self.assertTrue(
FileSystems.exists(
# To check the gcs directory with FileSystems, the dir path must
# end with /
os.path.join(
self.artifact_location,
handlers.RAW_DATA_METADATA_DIR + '/')))
> self.assertTrue(
FileSystems.exists(
os.path.join(
self.artifact_location,
handlers.RAW_DATA_METADATA_DIR,
handlers.SCHEMA_FILE)))
apache_beam/ml/transforms/handlers_test.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ac92c746460>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpqt6gvlik/tftransform_tmp/3cc5ed1baad74005a543dd954882533b'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
github-actions / Test Results
test_tft_process_handler_unused_column (apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTestWithGCSLocation) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 40s]
Raw output
RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7a1d504d8a90>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = 'gs://temp-storage-for-perf-tests/tft_handler/1ac2ab07a52848f1a059ec65834a55f0/tftransform_tmp/928447f849f546528f8732254ad736a2'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTestWithGCSLocation testMethod=test_tft_process_handler_unused_column>
def test_tft_process_handler_unused_column(self):
data = [
{
'x': [5, 1], 'y': 2
},
{
'x': [8, 4], 'y': 5
},
{
'x': [9, 5], 'y': 6
},
{
'x': [10, 6], 'y': 7
},
{
'x': [11, 7], 'y': 8
},
{
'x': [12, 8], 'y': 9
},
{
'x': [13, 9], 'y': 10
},
{
'x': [14, 10], 'y': 11
},
{
'x': [15, 11], 'y': 12
},
{
'x': [16, 12], 'y': 13
},
{
'x': [17, 13], 'y': 14
},
{
'x': [18, 14], 'y': 15
},
{
'x': [19, 15], 'y': 16
},
{
'x': [20, 16], 'y': 17
},
{
'x': [21, 17], 'y': 18
},
{
'x': [22, 18], 'y': 19
},
{
'x': [23, 19], 'y': 20
},
{
'x': [24, 20], 'y': 21
},
{
'x': [25, 21], 'y': 22
},
]
# pylint: disable=line-too-long
expected_data = [
beam.Row(
x=np.array([0.16666667, 0.], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=2),
beam.Row(
x=np.array([0.29166666, 0.125], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=5),
beam.Row(
x=np.array([0.33333334, 0.16666667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=6),
beam.Row(
x=np.array([0.375, 0.20833333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=7),
beam.Row(
x=np.array([0.41666666, 0.25], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=8),
beam.Row(
x=np.array([0.45833334, 0.29166666], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=9),
beam.Row(
x=np.array([0.5, 0.33333334], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=10),
beam.Row(
x=np.array([0.5416667, 0.375], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=11),
beam.Row(
x=np.array([0.5833333, 0.41666666], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=12),
beam.Row(
x=np.array([0.625, 0.45833334], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=13),
beam.Row(
x=np.array([0.6666667, 0.5], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=14),
beam.Row(
x=np.array([0.7083333, 0.5416667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=15),
beam.Row(
x=np.array([0.75, 0.5833333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=16),
beam.Row(
x=np.array([0.7916667, 0.625], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=17),
beam.Row(
x=np.array([0.8333333, 0.6666667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=18),
beam.Row(
x=np.array([0.875, 0.7083333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=19),
beam.Row(
x=np.array([0.9166667, 0.75], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=20),
beam.Row(
x=np.array([0.9583333, 0.7916667], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=21),
beam.Row(
x=np.array([1., 0.8333333], dtype=np.float32),
x_max=np.array([25.], dtype=np.float32),
x_min=np.array([1.], dtype=np.float32),
y=22),
]
# pylint: enable=line-too-long
expected_data_x = [row.x for row in expected_data]
expected_data_y = [row.y for row in expected_data]
scale_to_0_1_fn = tft.ScaleTo01(columns=['x'])
with beam.Pipeline() as p:
raw_data = p | beam.Create(data)
process_handler = handlers.TFTProcessHandler(
transforms=[scale_to_0_1_fn],
artifact_location=self.artifact_location,
)
transformed_pcoll = raw_data | process_handler
transformed_pcoll_x = transformed_pcoll | beam.Map(lambda x: x.x)
transformed_pcoll_y = transformed_pcoll | beam.Map(lambda x: x.y)
assert_that(
transformed_pcoll_x,
equal_to(expected_data_x, equals_fn=np.array_equal),
label='transformed data')
> assert_that(
transformed_pcoll_y,
equal_to(expected_data_y, equals_fn=np.array_equal),
label='unused column')
apache_beam/ml/transforms/handlers_test.py:509:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7a1d504d8a90>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = 'gs://temp-storage-for-perf-tests/tft_handler/1ac2ab07a52848f1a059ec65834a55f0/tftransform_tmp/928447f849f546528f8732254ad736a2'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.base_test.BaseMLTransformTest
github-actions / Test Results
test_ml_transform_on_dict (apache_beam.ml.transforms.base_test.BaseMLTransformTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 27s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b7a081e7340>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpw3c6y31g/ce4d72/tftransform_tmp/eff711741fa94a0b8b044baa2c85d029'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.base_test.BaseMLTransformTest testMethod=test_ml_transform_on_dict>
@unittest.skipIf(tft is None, 'tft module is not installed.')
def test_ml_transform_on_dict(self):
transforms = [tft.ScaleTo01(columns=['x'])]
data = [{'x': 1}, {'x': 2}]
with beam.Pipeline() as p:
result = (
p
| beam.Create(data)
| base.MLTransform(
write_artifact_location=self.artifact_location,
transforms=transforms))
expected_output = [
np.array([0.0], dtype=np.float32),
np.array([1.0], dtype=np.float32),
]
actual_output = result | beam.Map(lambda x: x.x)
> assert_that(
actual_output, equal_to(expected_output, equals_fn=np.array_equal))
apache_beam/ml/transforms/base_test.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7b7a081e7340>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmpw3c6y31g/ce4d72/tftransform_tmp/eff711741fa94a0b8b044baa2c85d029'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
Check warning on line 0 in apache_beam.ml.transforms.tft_test.ScaleToGaussianTest
github-actions / Test Results
test_gaussian_skewed (apache_beam.ml.transforms.tft_test.ScaleToGaussianTest) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 27s]
Raw output
RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7c717c0de490>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmplmbk2m7x/6fd4fa/tftransform_tmp/fc97b9f85e6348aca935fb746201ebc1'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.tft_test.ScaleToGaussianTest testMethod=test_gaussian_skewed>
def test_gaussian_skewed(self):
data = [
{
'x': 1
},
{
'x': 2
},
{
'x': 4
},
{
'x': 8
},
{
'x': 16
},
{
'x': 32
},
]
with beam.Pipeline() as p:
result = (
p
| "Create" >> beam.Create(data)
| "MLTransform" >> base.MLTransform(
write_artifact_location=self.artifact_location).with_transform(
tft.ScaleToZScore(columns=['x'])))
expected_data = [
np.array([-0.87733847], dtype=np.float32),
np.array([-0.78498703], dtype=np.float32),
np.array([-0.6002842], dtype=np.float32),
np.array([-0.23087855], dtype=np.float32),
np.array([0.5079328], dtype=np.float32),
np.array([1.9855555], dtype=np.float32),
]
actual_data = (result | beam.Map(lambda x: x.x))
> assert_that(actual_data, equal_to(expected_data, equals_fn=np.allclose))
apache_beam/ml/transforms/tft_test.py:281:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7c717c0de490>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = '/tmp/tmplmbk2m7x/6fd4fa/tftransform_tmp/fc97b9f85e6348aca935fb746201ebc1'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'MLTransform/TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError
github-actions / Test Results
test_consume_mode_with_extra_columns_in_the_input (apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTestWithGCSLocation) failed
sdks/python/test-suites/tox/py39/build/srcs/sdks/python/pytest_py39-ml.xml [took 34s]
Raw output
RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
> return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:1495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ac93c643e50>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = 'gs://temp-storage-for-perf-tests/tft_handler/74384a5f1d644c2d920f99cb35b65c9d/tftransform_tmp/03bbf14c856647c4bdbd389d0694c5bc'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E AssertionError
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: AssertionError
During handling of the above exception, another exception occurred:
self = <apache_beam.ml.transforms.handlers_test.TFTProcessHandlerTestWithGCSLocation testMethod=test_consume_mode_with_extra_columns_in_the_input>
def test_consume_mode_with_extra_columns_in_the_input(self):
with beam.Pipeline() as p:
raw_data = (
p
| beam.Create([{
'x': np.array([1, 3])
}, {
'x': np.array([4, 6])
}]))
process_handler = handlers.TFTProcessHandler(
transforms=[tft.ScaleTo01(columns=['x'])],
artifact_location=self.artifact_location,
)
> _ = raw_data | process_handler
apache_beam/ml/transforms/handlers_test.py:527:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:644: in __exit__
self.result = self.run()
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/pipeline.py:618: in run
return self.runner.run_pipeline(self, self._options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/direct/direct_runner.py:190: in run_pipeline
return runner.run_pipeline(pipeline, options)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:196: in run_pipeline
self._latest_run_result = self.run_via_runner_api(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:223: in run_via_runner_api
return self.run_stages(stage_context, stages)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:470: in run_stages
bundle_results = self._execute_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:795: in _execute_bundle
self._run_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1034: in _run_bundle
result, splits = bundle_manager.process_bundle(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1360: in process_bundle
result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
response = self.worker.do_instruction(request)
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:658: in do_instruction
return getattr(self, request_type)(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/sdk_worker.py:696: in process_bundle
bundle_processor.process_bundle(instruction_id))
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:1274: in process_bundle
input_op_by_transform_id[element.transform_id].process_encoded(
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
self.output(decoded_value)
apache_beam/runners/worker/operations.py:566: in apache_beam.runners.worker.operations.Operation.output
def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:568: in apache_beam.runners.worker.operations.Operation.output
_cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:259: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:348: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
_cast_to_operation(consumer).process(windowed_value)
apache_beam/runners/worker/operations.py:947: in apache_beam.runners.worker.operations.DoOperation.process
def process(self, o):
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1585: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:683: in apache_beam.runners.common.SimpleInvoker.invoke_process
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1680: in apache_beam.runners.common._OutputHandler.handle_process_outputs
self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1793: in apache_beam.runners.common._OutputHandler._write_value_to_tag
self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:262: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:949: in apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1497: in apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn, windowed_value)
apache_beam/runners/common.py:1606: in apache_beam.runners.common.DoFnRunner._reraise_augmented
raise new_exn
apache_beam/runners/common.py:1495: in apache_beam.runners.common.DoFnRunner.process
return self.do_fn_invoker.invoke_process(windowed_value)
apache_beam/runners/common.py:911: in apache_beam.runners.common.PerWindowInvoker.invoke_process
self._invoke_process_per_window(
apache_beam/runners/common.py:1053: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1670: in apache_beam.runners.common._OutputHandler.handle_process_outputs
for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tensorflow_transform.beam.impl._RunMetaGraphDoFn object at 0x7ac93c643e50>
batch = pyarrow.RecordBatch
CODED_SAMPLE: large_list<item: large_binary>
child 0, item: large_binary
x: large_list<item: float>
child 0, item: float
saved_model_dir = 'gs://temp-storage-for-perf-tests/tft_handler/74384a5f1d644c2d920f99cb35b65c9d/tftransform_tmp/03bbf14c856647c4bdbd389d0694c5bc'
def process(self, batch, saved_model_dir):
"""Runs the given graph to realize the outputs.
Runs the graph in a TF session for computing the output values of the
`Tensor`s, `SparseTensor`s, or `RaggedTensor`s, given an input row of data
(input `Tensor`s, `SparseTensor`s, or `RaggedTensor`s).
Args:
batch: the batch of elements being processed by the DoFn
saved_model_dir: Directory containing saved model.
Yields:
A representation of output features as a dict mapping keys (logical column
names) to values.
"""
if not hasattr(self, '_graph_state'):
# If available, acquire will return a cached _GraphStateCommon, since
# calling _make_graph_state is expensive.
self._graph_state = self._shared_graph_state_handle.acquire(
lambda: self._make_graph_state(saved_model_dir))
# This should remain true throughout the lifetime of this DoFn, regardless
# of whether or not self._graph_state was cached.
> assert self._graph_state.saved_model_dir == saved_model_dir
E RuntimeError: AssertionError [while running 'TFTProcessHandler/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']
target/.tox-py39-ml/py39-ml/lib/python3.9/site-packages/tensorflow_transform/beam/impl.py:413: RuntimeError