Skip to content

Add unit tests to the sql package #2427

Add unit tests to the sql package

Add unit tests to the sql package #2427

GitHub Actions / Test Results failed Jan 27, 2025 in 0s

1 fail, 21 skipped, 22 pass in 4m 8s

44 tests   22 ✅  4m 8s ⏱️
 1 suites  21 💤
 1 files     1 ❌

Results for commit b3dd0ad.

Annotations

Check warning on line 0 in apache_beam.examples.complete.distribopt_test.DistribOptimizationTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_basics (apache_beam.examples.complete.distribopt_test.DistribOptimizationTest) failed

sdks/python/pytest_postCommitExamples-direct-py310.xml [took 4s]
Raw output
ValueError: malformed node or string on line 1: <ast.Call object at 0x7c4744faffd0>
self = <apache_beam.examples.complete.distribopt_test.DistribOptimizationTest testMethod=test_basics>

    @pytest.mark.sickbay_dataflow
    @pytest.mark.examples_postcommit
    def test_basics(self):
      test_pipeline = TestPipeline(is_integration_test=True)
    
      # Setup the files with expected content.
      temp_location = test_pipeline.get_option('temp_location')
      input = '/'.join([temp_location, str(uuid.uuid4()), 'input.txt'])
      output = '/'.join([temp_location, str(uuid.uuid4()), 'result'])
      create_file(input, FILE_CONTENTS)
      extra_opts = {'input': input, 'output': output}
    
      # Run pipeline
      # Avoid dependency on SciPy
      scipy_mock = MagicMock()
      result_mock = MagicMock(x=np.ones(3))
      scipy_mock.optimize.minimize = MagicMock(return_value=result_mock)
      modules = {'scipy': scipy_mock, 'scipy.optimize': scipy_mock.optimize}
    
      with patch.dict('sys.modules', modules):
        from apache_beam.examples.complete import distribopt
        distribopt.run(
            test_pipeline.get_full_options_as_args(**extra_opts),
            save_main_session=False)
    
      # Load result file and compare.
      lines = read_files_from_pattern('%s*' % output).splitlines()
    
      # Only 1 result
      self.assertEqual(len(lines), 1)
    
      # parse result line and verify optimum
>     optimum = make_tuple(lines[0])

apache_beam/examples/complete/distribopt_test.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/ast.py:110: in literal_eval
    return _convert(node_or_string)
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/ast.py:99: in _convert
    return dict(zip(map(_convert, node.keys),
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/ast.py:109: in _convert
    return _convert_signed_num(node)
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/ast.py:83: in _convert_signed_num
    return _convert_num(node)
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/ast.py:74: in _convert_num
    _raise_malformed_node(node)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

node = <ast.Call object at 0x7c4744faffd0>

    def _raise_malformed_node(node):
        msg = "malformed node or string"
        if lno := getattr(node, 'lineno', None):
            msg += f' on line {lno}'
>       raise ValueError(msg + f': {node!r}')
E       ValueError: malformed node or string on line 1: <ast.Call object at 0x7c4744faffd0>

/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/ast.py:71: ValueError

Check notice on line 0 in .github

See this annotation in the file changed.

@github-actions github-actions / Test Results

21 skipped tests found

There are 21 skipped tests, see "Raw output" for the full list of skipped tests.
Raw output
apache_beam.examples.complete.juliaset.juliaset.juliaset_test.JuliaSetTest ‑ test_generate_fractal_image
apache_beam.examples.ml_transform.ml_transform_it_test
apache_beam.examples.snippets.transforms.elementwise.mltransform_test
apache_beam.examples.snippets.transforms.elementwise.runinference_test
apache_beam.ml.inference.huggingface_inference_it_test
apache_beam.ml.inference.huggingface_inference_test
apache_beam.ml.inference.onnx_inference_test
apache_beam.ml.inference.pytorch_inference_test
apache_beam.ml.inference.tensorflow_inference_test
apache_beam.ml.inference.tensorrt_inference_test
apache_beam.ml.inference.vertex_ai_inference_it_test
apache_beam.ml.inference.xgboost_inference_test
apache_beam.ml.transforms.handlers_test
apache_beam.ml.transforms.tft_test
apache_beam.runners.dask.dask_runner_test
apache_beam.testing.analyzers.perf_analysis_test
apache_beam.testing.benchmarks.cloudml.cloudml_benchmark_test
apache_beam.transforms.enrichment_handlers.feast_feature_store_it_test
apache_beam.transforms.enrichment_handlers.feast_feature_store_test
apache_beam.typehints.pytorch_type_compatibility_test
apache_beam.yaml.yaml_ml_test

Check notice on line 0 in .github

See this annotation in the file changed.

@github-actions github-actions / Test Results

44 tests found

There are 44 tests, see "Raw output" for the full list of tests.
Raw output
apache_beam.examples.avro_nyc_trips_it_test.AvroNycTripsIT ‑ test_avro_nyc_trips_output_files_on_small_input
apache_beam.examples.complete.autocomplete_it_test.AutocompleteIT ‑ test_autocomplete_output_files_on_small_input
apache_beam.examples.complete.distribopt_test.DistribOptimizationTest ‑ test_basics
apache_beam.examples.complete.estimate_pi_it_test.EstimatePiIT ‑ test_estimate_pi_output_file
apache_beam.examples.complete.game.hourly_team_score_it_test.HourlyTeamScoreIT ‑ test_hourly_team_score_output_checksum_on_small_input
apache_beam.examples.complete.game.user_score_it_test.UserScoreIT ‑ test_userscore_output_checksum_on_small_input
apache_beam.examples.complete.juliaset.juliaset.juliaset_test.JuliaSetTest ‑ test_generate_fractal_image
apache_beam.examples.complete.juliaset.juliaset.juliaset_test.JuliaSetTest ‑ test_output_file_format
apache_beam.examples.complete.tfidf_it_test.TfIdfIT ‑ test_basics
apache_beam.examples.complete.top_wikipedia_sessions_it_test.ComputeTopSessionsIT ‑ test_top_wikipedia_sessions_output_files_on_small_input
apache_beam.examples.cookbook.bigquery_side_input_it_test.BigQuerySideInputIT ‑ test_bigquery_side_input_it
apache_beam.examples.cookbook.bigquery_tornadoes_it_test.BigqueryTornadoesIT ‑ test_bigquery_tornadoes_it
apache_beam.examples.cookbook.coders_it_test.CodersIT ‑ test_coders_output_files_on_small_input
apache_beam.examples.cookbook.custom_ptransform_it_test.CustomPTransformIT ‑ test_custom_ptransform_output_files_on_small_input
apache_beam.examples.cookbook.filters_test.FiltersTest ‑ test_filters_output_bigquery_matcher
apache_beam.examples.cookbook.group_with_coder_test.GroupWithCoderTest ‑ test_basics_with_type_check
apache_beam.examples.cookbook.group_with_coder_test.GroupWithCoderTest ‑ test_basics_without_type_check
apache_beam.examples.cookbook.mergecontacts_test.MergeContactsTest ‑ test_mergecontacts
apache_beam.examples.cookbook.multiple_output_pardo_test.MultipleOutputParDo ‑ test_multiple_output_pardo
apache_beam.examples.dataframe.flight_delays_it_test.FlightDelaysTest ‑ test_flight_delays
apache_beam.examples.dataframe.wordcount_test.WordCountTest ‑ test_basics
apache_beam.examples.ml_transform.ml_transform_it_test
apache_beam.examples.snippets.transforms.elementwise.mltransform_test
apache_beam.examples.snippets.transforms.elementwise.runinference_test
apache_beam.examples.wordcount_debugging_test.WordCountDebuggingTest ‑ test_basics
apache_beam.examples.wordcount_minimal_test.WordCountMinimalTest ‑ test_basics
apache_beam.examples.wordcount_test.WordCountTest ‑ test_basics
apache_beam.ml.inference.huggingface_inference_it_test
apache_beam.ml.inference.huggingface_inference_test
apache_beam.ml.inference.onnx_inference_test
apache_beam.ml.inference.pytorch_inference_test
apache_beam.ml.inference.tensorflow_inference_test
apache_beam.ml.inference.tensorrt_inference_test
apache_beam.ml.inference.vertex_ai_inference_it_test
apache_beam.ml.inference.xgboost_inference_test
apache_beam.ml.transforms.handlers_test
apache_beam.ml.transforms.tft_test
apache_beam.runners.dask.dask_runner_test
apache_beam.testing.analyzers.perf_analysis_test
apache_beam.testing.benchmarks.cloudml.cloudml_benchmark_test
apache_beam.transforms.enrichment_handlers.feast_feature_store_it_test
apache_beam.transforms.enrichment_handlers.feast_feature_store_test
apache_beam.typehints.pytorch_type_compatibility_test
apache_beam.yaml.yaml_ml_test