Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add issue link to disabled TensorRT integration test #33079

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Add issue link to disabled TensorRT integration test

a90a100
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

Add issue link to disabled TensorRT integration test #33079

Add issue link to disabled TensorRT integration test
a90a100
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Results failed Nov 11, 2024 in 0s

37 fail, 190 skipped, 3 514 pass in 5m 54s

    4 files      4 suites   5m 54s ⏱️
3 741 tests 3 514 ✅ 190 💤 37 ❌
7 447 runs  6 619 ✅ 768 💤 60 ❌

Results for commit a90a100.

Annotations

Check warning on line 0 in apache_beam.io.fileio_test.MatchTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_match_files_one_directory_failure1 (apache_beam.io.fileio_test.MatchTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:690: in apache_beam.runners.common.SimpleInvoker.invoke_process
    windowed_value, self.process_method(windowed_value.value))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <apache_beam.io.fileio._MatchAllFn object at 0x7d579413e870>
file_pattern = '/runner/_work/beam/beam/sdks/python/test-suites/tox/py312/build/srcs/sdks/python/target/.tox-py312-cloud/py312-cloud/tmp/tmpy33q2e6s/*'

    def process(self, file_pattern: str) -> List[filesystem.FileMetadata]:
      # TODO: Should we batch the lookups?
      match_results = filesystems.FileSystems.match([file_pattern])
      match_result = match_results[0]
    
      if (not match_result.metadata_list and
          not EmptyMatchTreatment.allow_empty_match(file_pattern,
                                                    self._empty_match_treatment)):
>       raise BeamIOError(
            'Empty match for pattern %s. Disallowed.' % file_pattern)
E       apache_beam.io.filesystem.BeamIOError: Empty match for pattern /runner/_work/beam/beam/sdks/python/test-suites/tox/py312/build/srcs/sdks/python/target/.tox-py312-cloud/py312-cloud/tmp/tmpy33q2e6s/*. Disallowed. with exceptions None

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/fileio.py:178: BeamIOError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.io.fileio_test.MatchTest testMethod=test_match_files_one_directory_failure1>

    def test_match_files_one_directory_failure1(self):
      directories = [
          '%s%s' % (self._new_tempdir(), os.sep),
          '%s%s' % (self._new_tempdir(), os.sep)
      ]
    
      files = []
      files.append(self._create_temp_file(dir=directories[0]))
      files.append(self._create_temp_file(dir=directories[0]))
    
      with self.assertRaises(beam.io.filesystem.BeamIOError):
>       with TestPipeline() as p:

apache_beam/io/fileio_test.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.pipeline_test.PipelineTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_pipeline_as_context (apache_beam.pipeline_test.PipelineTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
exn = ValueError('msg')

    def raise_exception(exn):
>     raise exn
E     ValueError: msg

apache_beam/pipeline_test.py:387: ValueError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.pipeline_test.PipelineTest testMethod=test_pipeline_as_context>

    def test_pipeline_as_context(self):
      def raise_exception(exn):
        raise exn
    
      with self.assertRaises(ValueError):
>       with Pipeline() as p:

apache_beam/pipeline_test.py:390: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.io.fileio_test.ReadTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_fail_on_directories (apache_beam.io.fileio_test.ReadTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1677: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <apache_beam.io.fileio._ReadMatchesFn object at 0x7d5794187b90>
file_metadata = '/runner/_work/beam/beam/sdks/python/test-suites/tox/py312/build/srcs/sdks/python/target/.tox-py312-cloud/py312-cloud/tmp/tmpv1wx4v6t//'

    def process(
        self,
        file_metadata: Union[str, filesystem.FileMetadata],
    ) -> Iterable[ReadableFile]:
      metadata = (
          filesystem.FileMetadata(file_metadata, 0) if isinstance(
              file_metadata, str) else file_metadata)
    
      if ((metadata.path.endswith('/') or metadata.path.endswith('\\')) and
          self._skip_directories):
        return
      elif metadata.path.endswith('/') or metadata.path.endswith('\\'):
>       raise BeamIOError(
            'Directories are not allowed in ReadMatches transform.'
            'Found %s.' % metadata.path)
E       apache_beam.io.filesystem.BeamIOError: Directories are not allowed in ReadMatches transform.Found /runner/_work/beam/beam/sdks/python/test-suites/tox/py312/build/srcs/sdks/python/target/.tox-py312-cloud/py312-cloud/tmp/tmpv1wx4v6t//. with exceptions None

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/fileio.py:253: BeamIOError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.io.fileio_test.ReadTest testMethod=test_fail_on_directories>

    def test_fail_on_directories(self):
      content = 'thecontent\n'
      files = []
      tempdir = '%s%s' % (self._new_tempdir(), os.sep)
    
      # Create a couple files to be matched
      files.append(self._create_temp_file(dir=tempdir, content=content))
      files.append(self._create_temp_file(dir=tempdir, content=content))
    
      with self.assertRaises(beam.io.filesystem.BeamIOError):
>       with TestPipeline() as p:

apache_beam/io/fileio_test.py:263: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.io.gcp.experimental.spannerio_test.SpannerReadTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

1 out of 2 runs failed: test_invalid_transaction (apache_beam.io.gcp.experimental.spannerio_test.SpannerReadTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:917: in apache_beam.runners.common.PerWindowInvoker.invoke_process
    self._invoke_process_per_window(
apache_beam/runners/common.py:1059: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1677: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    for result in results:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <apache_beam.io.gcp.experimental.spannerio._NaiveSpannerReadDoFn object at 0x7d968098d7c0>
element = ReadOperation(is_sql=True, is_table=False, read_operation='process_query_batch', kwargs={'sql': 'Select * from users', 'params': None, 'param_types': None})
spanner_transaction = {'invalid': 'transaction'}

    def process(self, element, spanner_transaction):
      # `spanner_transaction` should be the instance of the _SPANNER_TRANSACTION
      # object.
      if not isinstance(spanner_transaction, _SPANNER_TRANSACTION):
>       raise ValueError(
            "Invalid transaction object: %s. It should be instance "
            "of SPANNER_TRANSACTION object created by "
            "spannerio.create_transaction transform." % type(spanner_transaction))
E       ValueError: Invalid transaction object: <class 'dict'>. It should be instance of SPANNER_TRANSACTION object created by spannerio.create_transaction transform.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/gcp/experimental/spannerio.py:401: ValueError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.io.gcp.experimental.spannerio_test.SpannerReadTest testMethod=test_invalid_transaction>
mock_batch_snapshot_class = <MagicMock name='BatchSnapshot' id='138085355765152'>
mock_client_class = <MagicMock name='Client' id='138085357420224'>

    def test_invalid_transaction(
        self, mock_batch_snapshot_class, mock_client_class):
      # test exception raises at pipeline execution time
>     with self.assertRaises(ValueError), TestPipeline() as p:

apache_beam/io/gcp/experimental/spannerio_test.py:390: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery

See this annotation in the file changed.

@github-actions github-actions / Test Results

1 out of 2 runs failed: test_create_temp_dataset_exception_0 (apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
Raw output
AssertionError: 'accessDenied' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"
a = (<apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery testMethod=test_create_temp_dataset_exception_0>,)
kw = {}

    @wraps(func)
    def standalone_func(*a, **kw):
>       return func(*(a + p.args), **p.kwargs, **kw)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/parameterized/parameterized.py:620: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/gcp/bigquery_test.py:464: in test_create_temp_dataset_exception
    self.assertIn(error_message, exc.exception.args[0])
E   AssertionError: 'accessDenied' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"

Check warning on line 0 in apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery

See this annotation in the file changed.

@github-actions github-actions / Test Results

1 out of 2 runs failed: test_create_temp_dataset_exception_1 (apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
Raw output
AssertionError: 'backendError' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"
a = (<apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery testMethod=test_create_temp_dataset_exception_1>,)
kw = {}

    @wraps(func)
    def standalone_func(*a, **kw):
>       return func(*(a + p.args), **p.kwargs, **kw)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/parameterized/parameterized.py:620: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/gcp/bigquery_test.py:464: in test_create_temp_dataset_exception
    self.assertIn(error_message, exc.exception.args[0])
E   AssertionError: 'backendError' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"

Check warning on line 0 in apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery

See this annotation in the file changed.

@github-actions github-actions / Test Results

1 out of 2 runs failed: test_query_job_exception_0 (apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
Raw output
AssertionError: 'invalidQuery' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"
a = (<apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery testMethod=test_query_job_exception_0>,)
kw = {}

    @wraps(func)
    def standalone_func(*a, **kw):
>       return func(*(a + p.args), **p.kwargs, **kw)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/parameterized/parameterized.py:620: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/gcp/bigquery_test.py:698: in test_query_job_exception
    self.assertIn(error_message, exc.exception.args[0])
E   AssertionError: 'invalidQuery' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"

Check warning on line 0 in apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery

See this annotation in the file changed.

@github-actions github-actions / Test Results

1 out of 2 runs failed: test_query_job_exception_1 (apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
Raw output
AssertionError: 'notFound' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"
a = (<apache_beam.io.gcp.bigquery_test.TestReadFromBigQuery testMethod=test_query_job_exception_1>,)
kw = {}

    @wraps(func)
    def standalone_func(*a, **kw):
>       return func(*(a + p.args), **p.kwargs, **kw)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/parameterized/parameterized.py:620: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/gcp/bigquery_test.py:698: in test_query_job_exception
    self.assertIn(error_message, exc.exception.args[0])
E   AssertionError: 'notFound' not found in "Argument 'exn' has incorrect type (expected BaseException, got tuple)"

Check warning on line 0 in apache_beam.testing.util_test.UtilTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_assert_missing (apache_beam.testing.util_test.UtilTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 1s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:917: in apache_beam.runners.common.PerWindowInvoker.invoke_process
    self._invoke_process_per_window(
apache_beam/runners/common.py:1061: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
    self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
    wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

actual = ['a', 'b']
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x794f42fcbe20>

    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: ['a', 'b', 'c'] == ['a', 'b'], missing elements ['c']

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/util.py:192: BeamAssertException

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.testing.util_test.UtilTest testMethod=test_assert_missing>

    def test_assert_missing(self):
      with self.assertRaisesRegex(BeamAssertException,
                                  r"missing elements \['c'\]"):
>       with TestPipeline() as p:

apache_beam/testing/util_test.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typecheck_test.RuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_setup (apache_beam.typehints.typecheck_test.RuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
type_constraint = <class 'int'>, datum = '1', is_input = False

    @staticmethod
    def type_check(type_constraint, datum, is_input):
      """Typecheck a PTransform related datum according to a type constraint.
    
      This function is used to optionally type-check either an input or an output
      to a PTransform.
    
      Args:
          type_constraint: An instance of a typehints.TypeContraint, one of the
            white-listed builtin Python types, or a custom user class.
          datum: An instance of a Python object.
          is_input: True if 'datum' is an input to a PTransform's DoFn. False
            otherwise.
    
      Raises:
        TypeError: If 'datum' fails to type-check according to 'type_constraint'.
      """
      datum_type = 'input' if is_input else 'output'
    
      try:
>       check_constraint(type_constraint, datum)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:201: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, object_instance = '1'

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck.OutputCheckWrapperDoFn object at 0x79c5750bf7d0>
method = <bound method TypeCheckWrapperDoFn.process of <apache_beam.typehints.typecheck.TypeCheckWrapperDoFn object at 0x79c5750bc560>>
args = (1,), kwargs = {}

    def wrapper(self, method, args, kwargs):
      try:
>       result = method(*args, **kwargs)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:95: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:151: in process
    return self._type_check_result(self.dofn.process(*args, **kwargs))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:178: in _type_check_result
    type_check_output(o)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:170: in type_check_output
    self.type_check(self._output_type_hint, x, is_input=False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:211: in type_check
    raise TypeCheckError(error_msg).with_traceback(tb)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:201: in type_check
    check_constraint(type_constraint, datum)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, object_instance = '1'

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.decorators.TypeCheckError: According to type-hint expected output should be of type <class 'int'>. Instead, received '1', an instance of type <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:690: in apache_beam.runners.common.SimpleInvoker.invoke_process
    windowed_value, self.process_method(windowed_value.value))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:78: in process
    return self.wrapper(self.dofn.process, args, kwargs)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:102: in wrapper
    raise TypeCheckError(error_msg).with_traceback(tb)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:95: in wrapper
    result = method(*args, **kwargs)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:151: in process
    return self._type_check_result(self.dofn.process(*args, **kwargs))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:178: in _type_check_result
    type_check_output(o)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:170: in type_check_output
    self.type_check(self._output_type_hint, x, is_input=False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:211: in type_check
    raise TypeCheckError(error_msg).with_traceback(tb)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typecheck.py:201: in type_check
    check_constraint(type_constraint, datum)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, object_instance = '1'

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(Map(fn)): According to type-hint expected output should be of type <class 'int'>. Instead, received '1', an instance of type <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.RuntimeTypeCheckTest testMethod=test_setup>

    def test_setup(self):
      # Verifies that runtime type checking is enabled for test cases.
      def fn(e: int) -> int:
        return str(e)  # type: ignore
    
      with self.assertRaisesRegex(TypeCheckError,
                                  r'output should be.*int.*received.*str'):
        _ = self.p | beam.Create([1, 2, 3]) | beam.Map(fn)
>       self.p.run()

apache_beam/typehints/typecheck_test.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.testing.util_test.UtilTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_assert_missing_and_unexpected (apache_beam.testing.util_test.UtilTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:917: in apache_beam.runners.common.PerWindowInvoker.invoke_process
    self._invoke_process_per_window(
apache_beam/runners/common.py:1061: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
    self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
    wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

actual = ['a', 'b', 'c']
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x794f472b42c0>

    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: ['a', 'b', 'd'] == ['a', 'b', 'c'], unexpected elements ['c'], missing elements ['d']

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/util.py:192: BeamAssertException

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.testing.util_test.UtilTest testMethod=test_assert_missing_and_unexpected>

    def test_assert_missing_and_unexpected(self):
      with self.assertRaisesRegex(
          BeamAssertException,
          r"unexpected elements \['c'\].*missing elements \['d'\]"):
>       with TestPipeline() as p:

apache_beam/testing/util_test.py:86: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_do_fn_returning_non_iterable_throws_error (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
AssertionError: False is not true : "Argument 'exn' has incorrect type (expected BaseException, got tuple)" does not start with "'int' object is not iterable "
self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_do_fn_returning_non_iterable_throws_error>

    def test_do_fn_returning_non_iterable_throws_error(self):
      # This function is incorrect because it returns a non-iterable object
      def incorrect_par_do_fn(x):
        return x + 5
    
      with self.assertRaises(TypeError) as cm:
        (self.p | beam.Create([1, 1]) | beam.FlatMap(incorrect_par_do_fn))
        self.p.run()
    
>     self.assertStartswith(cm.exception.args[0], "'int' object is not iterable ")

apache_beam/typehints/typecheck_test.py:204: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/typehints/typecheck_test.py:143: in assertStartswith
    self.assertTrue(
E   AssertionError: False is not true : "Argument 'exn' has incorrect type (expected BaseException, got tuple)" does not start with "'int' object is not iterable "

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_downstream_input_type_hint_error_has_descriptive_error_msg (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
type_constraint = <class 'str'>, instance = 9, var_name = 'element'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
>       check_constraint(type_constraint, instance)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'str'>, object_instance = 9

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

>   _check_instance_type(constraint, value, parameter_name, verbose=True)

apache_beam/runners/worker/opcounters.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'str'>, instance = 9, var_name = 'element'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Type-hint for argument: 'element' violated. Expected an instance of <class 'str'>, instead found 9, an instance of <class 'int'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: 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.update_counters_start(windowed_value)
apache_beam/runners/worker/operations.py:205: in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
    self.opcounter.update_from(windowed_value)
apache_beam/runners/worker/opcounters.py:210: in apache_beam.runners.worker.opcounters.OperationCounters.update_from
    self.do_sample(windowed_value)
apache_beam/runners/worker/opcounters.py:259: in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
    self.type_check(windowed_value.value)
apache_beam/runners/worker/opcounters.py:255: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    raise TypeCheckError(error_msg).with_traceback(traceback)
apache_beam/runners/worker/opcounters.py:246: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    _check_instance_type(constraint, value, parameter_name, verbose=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'str'>, instance = 9, var_name = 'element'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(StrToInt): Type-hint for argument: 'element' violated. Expected an instance of <class 'str'>, instead found 9, an instance of <class 'int'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_downstream_input_type_hint_error_has_descriptive_error_msg>

    def test_downstream_input_type_hint_error_has_descriptive_error_msg(self):
      @with_input_types(int)
      @with_output_types(int)
      class IntToInt(beam.DoFn):
        def process(self, element, *args, **kwargs):
          yield element
    
      @with_input_types(str)
      @with_output_types(int)
      class StrToInt(beam.DoFn):
        def process(self, element, *args, **kwargs):
          yield int(element)
    
      # This will raise a type check error in IntToInt even though the actual
      # type check error won't happen until StrToInt. The user will be told that
      # StrToInt's input type hints were not satisfied while running IntToInt.
      with self.assertRaises(TypeCheckError) as e:
        (
            self.p
            | beam.Create([9])
            | beam.ParDo(IntToInt())
            | beam.ParDo(StrToInt()))
>       self.p.run()

apache_beam/typehints/typecheck_test.py:316: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_pipeline_checking_satisfied_but_run_time_types_violate (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
self = Tuple[<class 'bool'>, <class 'int'>], tuple_instance = (0, 0)

    def type_check(self, tuple_instance):
      if not isinstance(tuple_instance, tuple):
        raise CompositeTypeHintError(
            "Tuple type constraint violated. Valid object instance must be of "
            "type 'tuple'. Instead, an instance of '%s' was received." %
            tuple_instance.__class__.__name__)
    
      if len(tuple_instance) != len(self.tuple_types):
        raise CompositeTypeHintError(
            'Passed object instance is of the proper type, but differs in '
            'length from the hinted type. Expected a tuple of length %s, '
            'received a tuple of length %s.' %
            (len(self.tuple_types), len(tuple_instance)))
    
      for type_pos, (expected, actual) in enumerate(zip(self.tuple_types,
                                                        tuple_instance)):
        try:
>         check_constraint(expected, actual)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:732: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'bool'>, object_instance = 0

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

type_constraint = Tuple[<class 'bool'>, <class 'int'>], instance = (0, 0)
var_name = None, verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
>       check_constraint(type_constraint, instance)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:429: in check_constraint
    type_constraint.type_check(object_instance)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = Tuple[<class 'bool'>, <class 'int'>], tuple_instance = (0, 0)

    def type_check(self, tuple_instance):
      if not isinstance(tuple_instance, tuple):
        raise CompositeTypeHintError(
            "Tuple type constraint violated. Valid object instance must be of "
            "type 'tuple'. Instead, an instance of '%s' was received." %
            tuple_instance.__class__.__name__)
    
      if len(tuple_instance) != len(self.tuple_types):
        raise CompositeTypeHintError(
            'Passed object instance is of the proper type, but differs in '
            'length from the hinted type. Expected a tuple of length %s, '
            'received a tuple of length %s.' %
            (len(self.tuple_types), len(tuple_instance)))
    
      for type_pos, (expected, actual) in enumerate(zip(self.tuple_types,
                                                        tuple_instance)):
        try:
          check_constraint(expected, actual)
          continue
        except SimpleTypeHintError:
>         raise CompositeTypeHintError(
              '%s hint type-constraint violated. The type of element #%s in '
              'the passed tuple is incorrect. Expected an instance of '
              'type %s, instead received an instance of type %s.' %
              (repr(self), type_pos, repr(expected), actual.__class__.__name__))
E         apache_beam.typehints.typehints.CompositeTypeHintError: Tuple[<class 'bool'>, <class 'int'>] hint type-constraint violated. The type of element #0 in the passed tuple is incorrect. Expected an instance of type <class 'bool'>, instead received an instance of type int.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:735: CompositeTypeHintError

During handling of the above exception, another exception occurred:

>   _check_instance_type(constraint, value, parameter_name, verbose=True)

apache_beam/runners/worker/opcounters.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = Tuple[<class 'bool'>, <class 'int'>], instance = (0, 0)
var_name = None, verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
        raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
      except CompositeTypeHintError as e:
>       raise TypeCheckError('Type-hint for %s violated: %s' % (hint_type, e))
E       apache_beam.typehints.decorators.TypeCheckError: Type-hint for return type violated: Tuple[<class 'bool'>, <class 'int'>] hint type-constraint violated. The type of element #0 in the passed tuple is incorrect. Expected an instance of type <class 'bool'>, instead received an instance of type int.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:898: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: 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.update_counters_start(windowed_value)
apache_beam/runners/worker/operations.py:205: in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
    self.opcounter.update_from(windowed_value)
apache_beam/runners/worker/opcounters.py:210: in apache_beam.runners.worker.opcounters.OperationCounters.update_from
    self.do_sample(windowed_value)
apache_beam/runners/worker/opcounters.py:259: in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
    self.type_check(windowed_value.value)
apache_beam/runners/worker/opcounters.py:255: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    raise TypeCheckError(error_msg).with_traceback(traceback)
apache_beam/runners/worker/opcounters.py:246: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    _check_instance_type(constraint, value, parameter_name, verbose=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = Tuple[<class 'bool'>, <class 'int'>], instance = (0, 0)
var_name = None, verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
        raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
      except CompositeTypeHintError as e:
>       raise TypeCheckError('Type-hint for %s violated: %s' % (hint_type, e))
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(IsEven): Type-hint for return type violated: Tuple[<class 'bool'>, <class 'int'>] hint type-constraint violated. The type of element #0 in the passed tuple is incorrect. Expected an instance of type <class 'bool'>, instead received an instance of type int.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:898: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_pipeline_checking_satisfied_but_run_time_types_violate>

    def test_pipeline_checking_satisfied_but_run_time_types_violate(self):
      self.p._options.view_as(TypeOptions).pipeline_type_check = False
    
      @with_output_types(Tuple[bool, int])
      @with_input_types(a=int)
      def is_even_as_key(a):
        # Simulate a programming error, should be: return (a % 2 == 0, a)
        # However this returns Tuple[int, int]
        return (a % 2, a)
    
      (
          self.p
          | 'Nums' >> beam.Create(range(1)).with_output_types(int)
          | 'IsEven' >> beam.Map(is_even_as_key)
          | 'Parity' >> beam.GroupByKey())
    
      with self.assertRaises(TypeCheckError) as e:
>       self.p.run()

apache_beam/typehints/typecheck_test.py:260: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_pipeline_runtime_checking_violation_composite_type_output (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
type_constraint = <class 'int'>, instance = 4.0, var_name = None, verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
>       check_constraint(type_constraint, instance)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, object_instance = 4.0

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

>   _check_instance_type(constraint, value, parameter_name, verbose=True)

apache_beam/runners/worker/opcounters.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = 4.0, var_name = None, verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Type-hint for return type violated. Expected an instance of <class 'int'>, instead found 4.0, an instance of <class 'float'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:346: in apache_beam.runners.worker.operations.GeneralPurposeConsumerSet.receive
    self.update_counters_start(windowed_value)
apache_beam/runners/worker/operations.py:205: in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
    self.opcounter.update_from(windowed_value)
apache_beam/runners/worker/opcounters.py:210: in apache_beam.runners.worker.opcounters.OperationCounters.update_from
    self.do_sample(windowed_value)
apache_beam/runners/worker/opcounters.py:259: in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
    self.type_check(windowed_value.value)
apache_beam/runners/worker/opcounters.py:255: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    raise TypeCheckError(error_msg).with_traceback(traceback)
apache_beam/runners/worker/opcounters.py:246: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    _check_instance_type(constraint, value, parameter_name, verbose=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = 4.0, var_name = None, verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(Swap): Type-hint for return type violated. Expected an instance of <class 'int'>, instead found 4.0, an instance of <class 'float'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_pipeline_runtime_checking_violation_composite_type_output>

    def test_pipeline_runtime_checking_violation_composite_type_output(self):
      self.p._options.view_as(TypeOptions).pipeline_type_check = False
    
      # The type-hinted applied via the 'returns()' method indicates the ParDo
      # should return an instance of type: Tuple[float, int]. However, an instance
      # of 'int' will be generated instead.
      with self.assertRaises(TypeCheckError) as e:
        (
            self.p
            | beam.Create([(1, 3.0)])
            | (
                'Swap' >>
                beam.FlatMap(lambda x_y1: [x_y1[0] + x_y1[1]]).with_input_types(
                    Tuple[int, float]).with_output_types(int)))
>       self.p.run()

apache_beam/typehints/typecheck_test.py:285: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.testing.util_test.UtilTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_assert_that_fails_on_is_not_empty_expected (apache_beam.testing.util_test.UtilTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:690: in apache_beam.runners.common.SimpleInvoker.invoke_process
    windowed_value, self.process_method(windowed_value.value))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/transforms/core.py:2086: in <lambda>
    wrapper = lambda x: [fn(x)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

actual = []

    def _not_empty(actual):
      actual = list(actual)
      if not actual:
>       raise BeamAssertException('Failed assert: pcol is empty')
E       apache_beam.testing.util.BeamAssertException: Failed assert: pcol is empty

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/util.py:232: BeamAssertException

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.testing.util_test.UtilTest testMethod=test_assert_that_fails_on_is_not_empty_expected>

    def test_assert_that_fails_on_is_not_empty_expected(self):
      with self.assertRaises(BeamAssertException):
>       with TestPipeline() as p:

apache_beam/testing/util_test.py:146: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_simple_input_error (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
type_constraint = <class 'str'>, instance = 1, var_name = 'x', verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
>       check_constraint(type_constraint, instance)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'str'>, object_instance = 1

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

>   _check_instance_type(constraint, value, parameter_name, verbose=True)

apache_beam/runners/worker/opcounters.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'str'>, instance = 1, var_name = 'x', verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Type-hint for argument: 'x' violated. Expected an instance of <class 'str'>, instead found 1, an instance of <class 'int'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: 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.update_counters_start(windowed_value)
apache_beam/runners/worker/operations.py:205: in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
    self.opcounter.update_from(windowed_value)
apache_beam/runners/worker/opcounters.py:210: in apache_beam.runners.worker.opcounters.OperationCounters.update_from
    self.do_sample(windowed_value)
apache_beam/runners/worker/opcounters.py:259: in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
    self.type_check(windowed_value.value)
apache_beam/runners/worker/opcounters.py:255: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    raise TypeCheckError(error_msg).with_traceback(traceback)
apache_beam/runners/worker/opcounters.py:246: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    _check_instance_type(constraint, value, parameter_name, verbose=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'str'>, instance = 1, var_name = 'x', verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(FlatMap(<lambda at typecheck_test.py:151>)): Type-hint for argument: 'x' violated. Expected an instance of <class 'str'>, instead found 1, an instance of <class 'int'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_simple_input_error>

    def test_simple_input_error(self):
      with self.assertRaises(TypeCheckError) as e:
        (
            self.p
            | beam.Create([1, 1])
            | beam.FlatMap(lambda x: [int(x)]).with_input_types(
                str).with_output_types(int))
>       self.p.run()

apache_beam/typehints/typecheck_test.py:153: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.io.requestresponse_test.TestCaller

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_call_runtime_error (apache_beam.io.requestresponse_test.TestCaller) failed

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
self = <apache_beam.io.requestresponse_test.CallerWithRuntimeError object at 0x7a6c2017fa70>
request = '', args = (), kwargs = {}

    def __call__(self, request: str, *args, **kwargs):
      if not request:
>       raise RuntimeError("Exception expected, not an error.")
E       RuntimeError: Exception expected, not an error.

apache_beam/io/requestresponse_test.py:71: RuntimeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1677: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    for result in results:
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:379: in process
    raise e
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:373: in process
    response = self._repeater.repeat(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/utils/retry.py:298: in wrapper
    return fun(*args, **kwargs)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:244: in repeat
    return _execute_request(caller, request, timeout, metrics_collector)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

caller = <apache_beam.io.requestresponse_test.CallerWithRuntimeError object at 0x7a6c2017fa70>
request = '', timeout = 30
metrics_collector = <apache_beam.io.requestresponse._MetricsCollector object at 0x7a6c20168d10>

    def _execute_request(
        caller: Caller[RequestT, ResponseT],
        request: RequestT,
        timeout: float,
        metrics_collector: Optional[_MetricsCollector] = None) -> ResponseT:
      with concurrent.futures.ThreadPoolExecutor() as executor:
        future = executor.submit(caller, request)
        try:
          return future.result(timeout=timeout)
        except TooManyRequests as e:
          _LOGGER.info(
              'request could not be completed. got code %i from the service.',
              e.code)
          raise e
        except concurrent.futures.TimeoutError:
          if metrics_collector:
            metrics_collector.timeout_requests.inc(1)
          raise UserCodeTimeoutException(
              f'Timeout {timeout} exceeded '
              f'while completing request: {request}')
        except RuntimeError:
          if metrics_collector:
            metrics_collector.failures.inc(1)
>         raise UserCodeExecutionException('could not complete request')
E         apache_beam.io.requestresponse.UserCodeExecutionException: could not complete request

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:209: UserCodeExecutionException

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.io.requestresponse_test.TestCaller testMethod=test_call_runtime_error>

    def test_call_runtime_error(self):
      caller = CallerWithRuntimeError()
      with self.assertRaises(UserCodeExecutionException):
>       with TestPipeline() as test_pipeline:

apache_beam/io/requestresponse_test.py:111: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typed_pipeline_test.MainInputTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_typed_flatmap_output_value_not_iterable (apache_beam.typehints.typed_pipeline_test.MainInputTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
AssertionError: "int.*is not iterable" does not match "Argument 'exn' has incorrect type (expected BaseException, got tuple)"
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   for result in results:
E   TypeError: 'int' object is not iterable

apache_beam/runners/common.py:1677: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "apache_beam/runners/common.py", line 1501, in apache_beam.runners.common.DoFnRunner.process
    return self.do_fn_invoker.invoke_process(windowed_value)
  File "apache_beam/runners/common.py", line 689, in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
  File "apache_beam/runners/common.py", line 1677, in apache_beam.runners.common._OutputHandler.handle_process_outputs
    for result in results:
TypeError: 'int' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apache_beam/runners/common.py", line 1501, in apache_beam.runners.common.DoFnRunner.process
    return self.do_fn_invoker.invoke_process(windowed_value)
  File "apache_beam/runners/common.py", line 689, in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
  File "apache_beam/runners/common.py", line 1687, in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
  File "apache_beam/runners/common.py", line 1800, in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
  File "apache_beam/runners/worker/operations.py", line 263, in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
  File "apache_beam/runners/worker/operations.py", line 950, in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
  File "apache_beam/runners/worker/operations.py", line 951, in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
  File "apache_beam/runners/common.py", line 1503, in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
  File "apache_beam/runners/common.py", line 1611, in apache_beam.runners.common.DoFnRunner._reraise_augmented
    self._maybe_sample_exception(exc_info, windowed_value)
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apache_beam/runners/common.py", line 1501, in apache_beam.runners.common.DoFnRunner.process
    return self.do_fn_invoker.invoke_process(windowed_value)
  File "apache_beam/runners/common.py", line 689, in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
  File "apache_beam/runners/common.py", line 1687, in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
  File "apache_beam/runners/common.py", line 1800, in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
  File "apache_beam/runners/worker/operations.py", line 263, in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
  File "apache_beam/runners/worker/operations.py", line 950, in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
  File "apache_beam/runners/worker/operations.py", line 951, in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
  File "apache_beam/runners/common.py", line 1503, in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
  File "apache_beam/runners/common.py", line 1611, in apache_beam.runners.common.DoFnRunner._reraise_augmented
    self._maybe_sample_exception(exc_info, windowed_value)
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

During handling of the above exception, another exception occurred:

TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typed_pipeline_test.MainInputTest testMethod=test_typed_flatmap_output_value_not_iterable>

    def test_typed_flatmap_output_value_not_iterable(self):
      def fn(element: int) -> typehints.Iterable[int]:
        return element * 2
    
      # This is raised in runners/common.py (process_outputs).
>     with self.assertRaisesRegex(TypeError, r'int.*is not iterable'):
E     AssertionError: "int.*is not iterable" does not match "Argument 'exn' has incorrect type (expected BaseException, got tuple)"

apache_beam/typehints/typed_pipeline_test.py:484: AssertionError

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_simple_input_error_with_kwarg_typehints (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
type_constraint = <class 'int'>, instance = '1', var_name = 'element'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
>       check_constraint(type_constraint, instance)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, object_instance = '1'

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

>   _check_instance_type(constraint, value, parameter_name, verbose=True)

apache_beam/runners/worker/opcounters.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = '1', var_name = 'element'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Type-hint for argument: 'element' violated. Expected an instance of <class 'int'>, instead found 1, an instance of <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: 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.update_counters_start(windowed_value)
apache_beam/runners/worker/operations.py:205: in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
    self.opcounter.update_from(windowed_value)
apache_beam/runners/worker/opcounters.py:210: in apache_beam.runners.worker.opcounters.OperationCounters.update_from
    self.do_sample(windowed_value)
apache_beam/runners/worker/opcounters.py:259: in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
    self.type_check(windowed_value.value)
apache_beam/runners/worker/opcounters.py:255: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    raise TypeCheckError(error_msg).with_traceback(traceback)
apache_beam/runners/worker/opcounters.py:246: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    _check_instance_type(constraint, value, parameter_name, verbose=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = '1', var_name = 'element'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(ToInt): Type-hint for argument: 'element' violated. Expected an instance of <class 'int'>, instead found 1, an instance of <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_simple_input_error_with_kwarg_typehints>

    def test_simple_input_error_with_kwarg_typehints(self):
      @with_input_types(element=int)
      @with_output_types(int)
      class ToInt(beam.DoFn):
        def process(self, element, *args, **kwargs):
          yield int(element)
    
      with self.assertRaises(TypeCheckError) as e:
        (self.p | beam.Create(['1', '1']) | beam.ParDo(ToInt()))
>       self.p.run()

apache_beam/typehints/typecheck_test.py:185: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.io.requestresponse_test.TestCaller

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_call_timeout (apache_beam.io.requestresponse_test.TestCaller) failed

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 19s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
args = (<apache_beam.io.requestresponse.ExponentialBackOffRepeater object at 0x7a6c2017ee10>, <apache_beam.io.requestresponse... at 0x7a6c2017eb10>, 'timeout_request', 1, <apache_beam.io.requestresponse._MetricsCollector object at 0x7a6c20185df0>)
kwargs = {}
retry_intervals = <generator object FuzzedExponentialIntervals.__iter__ at 0x7a6c201bc740>
exn_traceback = None, sleep_interval = 9.217407798465134

    @functools.wraps(fun)
    def wrapper(*args, **kwargs):
      retry_intervals = iter(
          FuzzedExponentialIntervals(
              initial_delay_secs,
              num_retries,
              factor,
              fuzz=0.5 if fuzz else 0,
              max_delay_secs=max_delay_secs,
              stop_after_secs=stop_after_secs))
      while True:
        try:
          return fun(*args, **kwargs)
        except Exception as exn:  # pylint: disable=broad-except
          if not retry_filter(exn):
            raise
          # Get the traceback object for the current exception. The
          # sys.exc_info() function returns a tuple with three elements:
          # exception type, exception value, and exception traceback.
          exn_traceback = sys.exc_info()[2]
          try:
            try:
>             sleep_interval = next(retry_intervals)
E             StopIteration

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/utils/retry.py:308: StopIteration

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1677: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    for result in results:
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:379: in process
    raise e
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:373: in process
    response = self._repeater.repeat(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/utils/retry.py:311: in wrapper
    raise exn.with_traceback(exn_traceback)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/utils/retry.py:298: in wrapper
    return fun(*args, **kwargs)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:244: in repeat
    return _execute_request(caller, request, timeout, metrics_collector)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

caller = <apache_beam.io.requestresponse_test.CallerWithTimeout object at 0x7a6c2017eb10>
request = 'timeout_request', timeout = 1
metrics_collector = <apache_beam.io.requestresponse._MetricsCollector object at 0x7a6c20185df0>

    def _execute_request(
        caller: Caller[RequestT, ResponseT],
        request: RequestT,
        timeout: float,
        metrics_collector: Optional[_MetricsCollector] = None) -> ResponseT:
      with concurrent.futures.ThreadPoolExecutor() as executor:
        future = executor.submit(caller, request)
        try:
          return future.result(timeout=timeout)
        except TooManyRequests as e:
          _LOGGER.info(
              'request could not be completed. got code %i from the service.',
              e.code)
          raise e
        except concurrent.futures.TimeoutError:
          if metrics_collector:
            metrics_collector.timeout_requests.inc(1)
>         raise UserCodeTimeoutException(
              f'Timeout {timeout} exceeded '
              f'while completing request: {request}')
E         apache_beam.io.requestresponse.UserCodeTimeoutException: Timeout 1 exceeded while completing request: timeout_request

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/io/requestresponse.py:203: UserCodeTimeoutException

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.io.requestresponse_test.TestCaller testMethod=test_call_timeout>

    def test_call_timeout(self):
      caller = CallerWithTimeout()
      with self.assertRaises(UserCodeTimeoutException):
>       with TestPipeline() as test_pipeline:

apache_beam/io/requestresponse_test.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_simple_output_error (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
type_constraint = <class 'int'>, instance = '1', var_name = 'x', verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
>       check_constraint(type_constraint, instance)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, object_instance = '1'

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

>   _check_instance_type(constraint, value, parameter_name, verbose=True)

apache_beam/runners/worker/opcounters.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = '1', var_name = 'x', verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Type-hint for argument: 'x' violated. Expected an instance of <class 'int'>, instead found 1, an instance of <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: 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.update_counters_start(windowed_value)
apache_beam/runners/worker/operations.py:205: in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
    self.opcounter.update_from(windowed_value)
apache_beam/runners/worker/opcounters.py:210: in apache_beam.runners.worker.opcounters.OperationCounters.update_from
    self.do_sample(windowed_value)
apache_beam/runners/worker/opcounters.py:259: in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
    self.type_check(windowed_value.value)
apache_beam/runners/worker/opcounters.py:255: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    raise TypeCheckError(error_msg).with_traceback(traceback)
apache_beam/runners/worker/opcounters.py:246: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    _check_instance_type(constraint, value, parameter_name, verbose=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = '1', var_name = 'x', verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(FlatMap(<lambda at typecheck_test.py:166>)): Type-hint for argument: 'x' violated. Expected an instance of <class 'int'>, instead found 1, an instance of <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_simple_output_error>

    def test_simple_output_error(self):
      with self.assertRaises(TypeCheckError) as e:
        (
            self.p
            | beam.Create(['1', '1'])
            | beam.FlatMap(lambda x: [int(x)]).with_input_types(
                int).with_output_types(int))
>       self.p.run()

apache_beam/typehints/typecheck_test.py:168: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_simple_type_violation (apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 0s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
type_constraint = <class 'int'>, instance = 'some_string', var_name = 'x'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
>       check_constraint(type_constraint, instance)

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:887: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, object_instance = 'some_string'

    def check_constraint(type_constraint, object_instance):
      """Determine if the passed type instance satisfies the TypeConstraint.
    
      When examining a candidate type for constraint satisfaction in
      'type_check', all CompositeTypeHint's eventually call this function. This
      function may end up being called recursively if the hinted type of a
      CompositeTypeHint is another CompositeTypeHint.
    
      Args:
        type_constraint: An instance of a TypeConstraint or a built-in Python type.
        object_instance: An object instance.
    
      Raises:
        SimpleTypeHintError: If 'type_constraint' is a one of the allowed primitive
          Python types and 'object_instance' isn't an instance of this type.
        CompositeTypeHintError: If 'type_constraint' is a TypeConstraint object and
          'object_instance' does not satisfy its constraint.
      """
      if type_constraint is None and object_instance is None:
        return
      elif isinstance(type_constraint, TypeConstraint):
        type_constraint.type_check(object_instance)
      elif type_constraint is None:
        # TODO(robertwb): Fix uses of None for Any.
        pass
      elif not isinstance(type_constraint, type):
        raise RuntimeError("bad type: %s" % (type_constraint, ))
      elif not isinstance(object_instance, type_constraint):
>       raise SimpleTypeHintError
E       apache_beam.typehints.typehints.SimpleTypeHintError

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/typehints.py:436: SimpleTypeHintError

During handling of the above exception, another exception occurred:

>   _check_instance_type(constraint, value, parameter_name, verbose=True)

apache_beam/runners/worker/opcounters.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = 'some_string', var_name = 'x'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Type-hint for argument: 'x' violated. Expected an instance of <class 'int'>, instead found some_string, an instance of <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: 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.update_counters_start(windowed_value)
apache_beam/runners/worker/operations.py:205: in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
    self.opcounter.update_from(windowed_value)
apache_beam/runners/worker/opcounters.py:210: in apache_beam.runners.worker.opcounters.OperationCounters.update_from
    self.do_sample(windowed_value)
apache_beam/runners/worker/opcounters.py:259: in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
    self.type_check(windowed_value.value)
apache_beam/runners/worker/opcounters.py:255: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    raise TypeCheckError(error_msg).with_traceback(traceback)
apache_beam/runners/worker/opcounters.py:246: in apache_beam.runners.worker.opcounters.OperationCounters.type_check
    _check_instance_type(constraint, value, parameter_name, verbose=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type_constraint = <class 'int'>, instance = 'some_string', var_name = 'x'
verbose = True

    def _check_instance_type(
        type_constraint, instance, var_name=None, verbose=False):
      """A helper function to report type-hint constraint violations.
    
      Args:
        type_constraint: An instance of a 'TypeConstraint' or a built-in Python
          type.
        instance: The candidate object which will be checked by to satisfy
          'type_constraint'.
        var_name: If 'instance' is an argument, then the actual name for the
          parameter in the original function definition.
    
      Raises:
        TypeCheckError: If 'instance' fails to meet the type-constraint of
          'type_constraint'.
      """
      hint_type = (
          "argument: '%s'" % var_name if var_name is not None else 'return type')
    
      try:
        check_constraint(type_constraint, instance)
      except SimpleTypeHintError:
        if verbose:
          verbose_instance = '%s, ' % instance
        else:
          verbose_instance = ''
>       raise TypeCheckError(
            'Type-hint for %s violated. Expected an '
            'instance of %s, instead found %san instance of %s.' %
            (hint_type, type_constraint, verbose_instance, type(instance)))
E       apache_beam.typehints.decorators.TypeCheckError: Runtime type violation detected within ParDo(ToStr): Type-hint for argument: 'x' violated. Expected an instance of <class 'int'>, instead found some_string, an instance of <class 'str'>.

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/typehints/decorators.py:893: TypeCheckError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.typehints.typecheck_test.PerformanceRuntimeTypeCheckTest testMethod=test_simple_type_violation>

    def test_simple_type_violation(self):
      self.p._options.view_as(TypeOptions).pipeline_type_check = False
    
      @with_output_types(str)
      @with_input_types(x=int)
      def int_to_string(x):
        return str(x)
    
      (
          self.p
          | 'Create' >> beam.Create(['some_string'])
          | 'ToStr' >> beam.Map(int_to_string))
      with self.assertRaises(TypeCheckError) as e:
>       self.p.run()

apache_beam/typehints/typecheck_test.py:234: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.testing.util_test.UtilTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_assert_unexpected (apache_beam.testing.util_test.UtilTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 1s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:917: in apache_beam.runners.common.PerWindowInvoker.invoke_process
    self._invoke_process_per_window(
apache_beam/runners/common.py:1061: in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window
    self.process_method(*args_for_process, **kwargs_for_process),
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/transforms/core.py:2084: in <lambda>
    wrapper = lambda x, *args, **kwargs: [fn(x, *args, **kwargs)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

actual = ['a', 'b', 'c', 'd']
equals_fn = <function equal_to.<locals>._equal.<locals>.<lambda> at 0x794f543a6660>

    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: ['a', 'b'] == ['a', 'b', 'c', 'd'], unexpected elements ['c', 'd']

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/util.py:192: BeamAssertException

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.testing.util_test.UtilTest testMethod=test_assert_unexpected>

    def test_assert_unexpected(self):
      with self.assertRaisesRegex(BeamAssertException,
                                  r"unexpected elements \['c', 'd'\]|"
                                  r"unexpected elements \['d', 'c'\]"):
>       with TestPipeline() as p:

apache_beam/testing/util_test.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

Check warning on line 0 in apache_beam.testing.util_test.UtilTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs failed: test_equal_to_per_window_fail_unexpected_element (apache_beam.testing.util_test.UtilTest)

sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312-cloud.xml [took 0s]
sdks/python/test-suites/tox/py312/build/srcs/sdks/python/pytest_py312.xml [took 1s]
Raw output
TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)
windowed_value = TestWindowedValue(value=('k', [1, 2]), timestamp=Timestamp(-9223372036840), windows=[[-9223372036854.775, -9223372036840.0)])

    def match(windowed_value):
      actual = windowed_value.value
      window_key = windowed_value.windows[0]
      try:
        _expected[window_key]
      except KeyError:
        raise BeamAssertException(
            'Failed assert: window {} not found in any expected ' \
            'windows {}'.format(window_key, list(_expected.keys())))\
    
      # Remove any matched elements from the window. This is used later on to
      # assert that all elements in the window were matched with actual
      # elements.
      try:
>       _expected[window_key].remove(actual)
E       ValueError: list.remove(x): x not in list

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/util.py:110: ValueError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:690: in apache_beam.runners.common.SimpleInvoker.invoke_process
    windowed_value, self.process_method(windowed_value.value))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/transforms/core.py:2086: in <lambda>
    wrapper = lambda x: [fn(x)]
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/util.py:124: in __call__
    match(windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

windowed_value = TestWindowedValue(value=('k', [1, 2]), timestamp=Timestamp(-9223372036840), windows=[[-9223372036854.775, -9223372036840.0)])

    def match(windowed_value):
      actual = windowed_value.value
      window_key = windowed_value.windows[0]
      try:
        _expected[window_key]
      except KeyError:
        raise BeamAssertException(
            'Failed assert: window {} not found in any expected ' \
            'windows {}'.format(window_key, list(_expected.keys())))\
    
      # Remove any matched elements from the window. This is used later on to
      # assert that all elements in the window were matched with actual
      # elements.
      try:
        _expected[window_key].remove(actual)
      except ValueError:
>       raise BeamAssertException(
            'Failed assert: element {} not found in window ' \
            '{}:{}'.format(actual, window_key, _expected[window_key]))\
E           apache_beam.testing.util.BeamAssertException: Failed assert: element ('k', [1, 2]) not found in window [-9223372036854.775, -9223372036840.0):[('k', [1])]

target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/util.py:112: BeamAssertException

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

>   return self.do_fn_invoker.invoke_process(windowed_value)

apache_beam/runners/common.py:1501: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/common.py:689: in apache_beam.runners.common.SimpleInvoker.invoke_process
    self.output_handler.handle_process_outputs(
apache_beam/runners/common.py:1687: in apache_beam.runners.common._OutputHandler.handle_process_outputs
    self._write_value_to_tag(tag, windowed_value, watermark_estimator)
apache_beam/runners/common.py:1800: in apache_beam.runners.common._OutputHandler._write_value_to_tag
    self.main_receivers.receive(windowed_value)
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError

During handling of the above exception, another exception occurred:

self = <apache_beam.testing.util_test.UtilTest testMethod=test_equal_to_per_window_fail_unexpected_element>

    def test_equal_to_per_window_fail_unexpected_element(self):
      with self.assertRaises(BeamAssertException):
        start = int(MIN_TIMESTAMP.micros // 1e6) - 5
        end = start + 20
        expected = {
            window.IntervalWindow(start, end): [('k', [1])],
        }
>       with TestPipeline(options=StandardOptions(streaming=True)) as p:

apache_beam/testing/util_test.py:244: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:620: in __exit__
    self.result = self.run()
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/testing/test_pipeline.py:115: in run
    result = super().run(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:570: in run
    self._options).run(False)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/pipeline.py:594: in run
    return self.runner.run_pipeline(self, self._options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/direct/direct_runner.py:184: in run_pipeline
    return runner.run_pipeline(pipeline, options)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:195: in run_pipeline
    self._latest_run_result = self.run_via_runner_api(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:221: in run_via_runner_api
    return self.run_stages(stage_context, stages)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:468: in run_stages
    bundle_results = self._execute_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:793: in _execute_bundle
    self._run_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1032: in _run_bundle
    result, splits = bundle_manager.process_bundle(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py:1358: in process_bundle
    result_future = self._worker_handler.control_conn.push(process_bundle_req)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:386: in push
    response = self.worker.do_instruction(request)
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:656: in do_instruction
    return getattr(self, request_type)(
target/.tox-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/sdk_worker.py:694: in process_bundle
    bundle_processor.process_bundle(instruction_id))
target/.tox-py312-cloud/py312-cloud/lib/python3.12/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-py312-cloud/py312-cloud/lib/python3.12/site-packages/apache_beam/runners/worker/bundle_processor.py:237: in process_encoded
    self.output(decoded_value)
apache_beam/runners/worker/operations.py:567: in apache_beam.runners.worker.operations.Operation.output
    def output(self, windowed_value, output_index=0):
apache_beam/runners/worker/operations.py:569: in apache_beam.runners.worker.operations.Operation.output
    _cast_to_receiver(self.receivers[output_index]).receive(windowed_value)
apache_beam/runners/worker/operations.py:260: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    def receive(self, windowed_value):
apache_beam/runners/worker/operations.py:263: in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive
    self.consumer.process(windowed_value)
apache_beam/runners/worker/operations.py:950: in apache_beam.runners.worker.operations.DoOperation.process
    with self.scoped_process_state:
apache_beam/runners/worker/operations.py:951: in apache_beam.runners.worker.operations.DoOperation.process
    delayed_applications = self.dofn_runner.process(o)
apache_beam/runners/common.py:1503: in apache_beam.runners.common.DoFnRunner.process
    self._reraise_augmented(exn, windowed_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   self._maybe_sample_exception(exc_info, windowed_value)
E   TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple)

apache_beam/runners/common.py:1611: TypeError