github-actions[bot] commented on PR #40916: URL: https://github.com/apache/beam/pull/40916#issuecomment-6842654490
<!-- beam-ci-failure-summary --> ## 🔍 CI Failure Summary ❌ **4 failed check(s)** (out of 86 total) on [`812ff71`](https://github.com/apache/beam/commit/812ff71b56c7a003a99b1e8253e595c67d151a0c) — grouped into **1 root-cause group(s)**. > **TL;DR:** All 4 Windows Python Unit Test matrix jobs failed due to unescaped Windows backslash path separators interpolated inside double-quoted YAML strings in the newly added `YamlTFRecordTest.test_write_and_read_tfrecord` in `sdks/python/apache_beam/yaml/yaml_io_test.py`. Replace `"{prefix}"` with `{repr(prefix)}` (or single quotes / `json.dumps`) to fix YAML parsing on Windows. ### 1. Windows Path Backslash Escape Failure in `YamlTFRecordTest.test_write_and_read_tfrecord` (4 check(s)) - **Classification:** `🔴 Likely related to PR changes` - **Root Cause:** In `sdks/python/apache_beam/yaml/yaml_io_test.py`, `YamlTFRecordTest.test_write_and_read_tfrecord` constructs `prefix = os.path.join(tmpdir, 'data')` and interpolates it into double-quoted YAML strings (`file_path_prefix: "{prefix}"` and `file_pattern: "{prefix}*.tfrecord"`). On Windows runners (`windows-latest`), `prefix` contains backslashes (e.g., `C:\Users\runneradmin\AppData\Local\Temp\...\data`), which YAML parses as invalid escape sequences (`\U`, `\r`, `\A`, `\L`, `\T`, `\d`) inside double-quoted scalars, raising `yaml.scanner.ScannerError` (whereas Linux and macOS paths use forward slashes and pass). - **Suggested Action:** In `sdks/python/apache_beam/yaml/yaml_io_test.py` (lines 1169 and 1179), use `repr(prefix)` / single-quoted YAML strings (matching `yaml_transform_test.py`), e.g.: ```python file_path_prefix: {repr(prefix)} ``` and ```python file_pattern: {repr(prefix + '*.tfrecord')} ``` Reproduce locally with: ```bash pytest sdks/python/apache_beam/yaml/yaml_io_test.py -k YamlTFRecordTest ``` <details> <summary>Representative log & affected check links</summary> - [Python Unit Tests (windows-latest, 3.11, py311)](https://github.com/apache/beam/actions/runs/41924353406/job/126904713837) - [Python Unit Tests (windows-latest, 3.12, py312)](https://github.com/apache/beam/actions/runs/41924353406/job/126904714106) - [Python Unit Tests (windows-latest, 3.13, py313)](https://github.com/apache/beam/actions/runs/41924353406/job/126904714154) - [Python Unit Tests (windows-latest, 3.14, py314)](https://github.com/apache/beam/actions/runs/41924353406/job/126904714134) ```text FAILED apache_beam/yaml/yaml_io_test.py::YamlTFRecordTest::test_write_and_read_tfrecord File "sdks\python\apache_beam\yaml\yaml_io_test.py", line 1165, in test_write_and_read_tfrecord | YamlTransform( f''' type: WriteToTFRecord config: file_path_prefix: "{prefix}" file_name_suffix: ".tfrecord" num_shards: 1 ''') File "sdks\python\apache_beam\yaml\yaml_transform.py", line 1044, in __init__ self._spec = yaml_utils.parse_yaml(spec) yaml.scanner.ScannerError: while scanning a double-quoted scalar in "<unicode string>", line 4, column 37: file_path_prefix: "C:\Users\runneradmin\AppData\Local\Temp\..." ^ found unknown escape character 'U' ``` </details> --- *💡 Comment `/summarize-failures` to refresh this summary after new commits or re-runs.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
