Skip to content

[Data] Adding MCAP datasource - #55716

Merged
richardliaw merged 40 commits into
masterfrom
data_mcap
Oct 11, 2025
Merged

richardliaw merged 40 commits into
masterfrom
data_mcap

Conversation

@soffer-anyscale

@soffer-anyscale soffer-anyscale commented Aug 18, 2025 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

MCAP is a common data format needed for robotics and Ray Data workloads. This PR adds native support for it.

Checks


Note

Introduce MCAP file support with read_mcap, including filtering and metadata options, docs, and tests.

  • Data API
    • Add read_mcap(paths, channels|topics, time_range, message_types, include_metadata, ...) for reading MCAP files with predicate pushdown and optional path/metadata inclusion.
    • Export read_mcap in ray.data.__init__ and list in API reference.
  • Datasource
    • New MCAPDatasource implementing MCAP reads using mcap reader with topic/channel, time-range filtering, optional message type filtering, and JSON decoding.
    • Expose MCAPDatasource via ray.data.datasource package exports.
  • Docs
    • Add MCAP (Message Capture) section to Input/Output docs.
  • Tests/Build
    • Add tests/test_mcap.py covering basic read, multi-file/dir reads, filters, metadata/paths, error cases, and block overrides.
    • Register test_mcap in python/ray/data/BUILD.bazel.
  • Misc
    • Update Vale vocabulary to accept MCAP.

Written by Cursor Bugbot for commit 34654a6. This will update automatically on new commits. Configure here.

Signed-off-by: soffer-anyscale <[email protected]>
@soffer-anyscale
soffer-anyscale requested a review from a team as a code owner August 18, 2025 23:20

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new MCAPDatasource for reading MCAP files, a common format in robotics. The implementation includes predicate pushdown for filtering and support for external indexing to optimize reads. My review focuses on improving performance, security, and code quality. Key suggestions include optimizing file reading to avoid loading entire files into memory, fixing a potential SQL injection vulnerability, and improving error handling and test correctness. There also appears to be an unrelated but important issue in python/ray/data/datasource/__init__.py that I've flagged.

Comment thread python/ray/data/datasource/__init__.py Resolved
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation data Ray Data-related issues labels Aug 19, 2025
Signed-off-by: soffer-anyscale <[email protected]>
Signed-off-by: soffer-anyscale <[email protected]>
Signed-off-by: soffer-anyscale <[email protected]>
Signed-off-by: soffer-anyscale <[email protected]>
Signed-off-by: soffer-anyscale <[email protected]>
- Add MCAP section to input_output.rst
- Include read_mcap in the autosummary directive
- Fix API documentation discrepancy for ray.data.read_api.read_mcap

Signed-off-by: soffer-anyscale <[email protected]>
- Fix doctest skip directives in MCAPDatasource to prevent ImportError during doc tests
- Rewrite MCAP tests to use ray.data.read_mcap() instead of MCAPDatasource directly
- Create real MCAP files for testing instead of using mocks
- Update all docstrings to follow Ray's Google pydoc style guide
- Apply Black code formatting standards throughout
- Ensure PEP 8 compliance for imports, naming, and structure
- Add comprehensive test coverage for all MCAP functionality including:
  - Basic reading functionality
  - Channel and topic filtering
  - Time range filtering
  - Message type filtering
  - Multiple file reading
  - Path inclusion and metadata control
  - Error handling scenarios

This brings the MCAP datasource fully in line with Ray project coding standards
and testing patterns used by other file-based datasources.

Signed-off-by: soffer-anyscale <[email protected]>
Auto-formatted by Ray's pre-push hook using Black 22.10.0

Signed-off-by: soffer-anyscale <[email protected]>
Signed-off-by: soffer-anyscale <[email protected]>
- Move internal datasource imports to the top in alphabetical order
- Organize imports according to linting standards
- Remove duplicate imports

Signed-off-by: soffer-anyscale <[email protected]>
- Move MCAPDatasource import to correct alphabetical position in read_api.py
- Spell out MCAP acronym in documentation with Vale disable directive

Signed-off-by: soffer-anyscale <[email protected]>
- Refactor MCAPDatasource from 692 to 255 lines (~63% reduction)
- Remove unnecessary complexity: standalone mode, complex caching, custom get_read_tasks
- Keep full features: advanced filtering, predicate pushdown, metadata support
- Follow established FileBasedDatasource patterns like audio/video datasources
- Update tests to match Ray Data test patterns (function-based, standard fixtures)
- Maintain comprehensive test coverage with cleaner, more maintainable code

Signed-off-by: soffer-anyscale <[email protected]>
Comment thread doc/source/data/api/input_output.rst Resolved
…g, and add comprehensive tests

- Added MCAP to Vale vocabulary to eliminate false spelling errors
- Removed Vale disable/enable comments from documentation
- Fixed include_paths functionality to use correct field name
- Enhanced error handling with MCAP file validation
- Added comprehensive channel filtering test
- Fixed type hints and docstring formatting for linting compliance
- All pre-commit hooks now pass successfully

Signed-off-by: soffer-anyscale <[email protected]>
Resolve conflicts in python/ray/data/datasource/__init__.py:
- Add missing ParquetMetadataProvider import
- Include MCAPDatasource and ParquetMetadataProvider in __all__ list
- Maintain proper alphabetical ordering

The MCAP datasource integration is now compatible with the latest master branch.

Signed-off-by: soffer-anyscale <[email protected]>
cursor[bot]

This comment was marked as outdated.

Key improvements:
- Fix MCAP summary requirement: Allow files without summaries since they're optional
- Fix JSON data decoding: Automatically decode JSON-encoded message data to Python objects
- Add comprehensive test for JSON decoding functionality

These changes improve compatibility with MCAP files and provide better user experience
for robotics data processing workflows.

Signed-off-by: soffer-anyscale <[email protected]>
- Move json import to module level to avoid import timing issues
- Add more detailed error logging for debugging build failures
- Enhance test robustness with better assertions and cleanup
- Add explicit file existence checks and error messages

These changes should help diagnose and prevent random build failures
by making the code more deterministic and providing better error information.

Signed-off-by: soffer-anyscale <[email protected]>
cursor[bot]

This comment was marked as outdated.

Remove accidentally included imports that were not related to MCAP feature:
- Remove DeltaSharingDatasource import and __all__ entry
- Remove ParquetMetadataProvider import and __all__ entry

These were mistakenly included during merge conflict resolution and should
not be part of the MCAP datasource feature commit. Only MCAPDatasource
import and export should be added for this feature.

Signed-off-by: soffer-anyscale <[email protected]>
cursor[bot]

This comment was marked as outdated.

The read_mcap function was imported but missing from the __all__ list,
creating an inconsistency with other read_* functions and preventing
users from accessing it via 'from ray.data import *'.

Added read_mcap to __all__ list in alphabetical order between
read_lance and read_numpy for consistency with the existing pattern.

Signed-off-by: soffer-anyscale <[email protected]>
Resolves F841 linting error where 'summary' was assigned but never used.
The summary assignment was left over from when summary validation was
removed to support optional MCAP summaries.

Since MCAP summaries are optional and we don't need to validate them,
the assignment has been removed entirely.

Signed-off-by: soffer-anyscale <[email protected]>
richardliaw and others added 6 commits October 10, 2025 17:11
- Removed channels parameter from MCAPDatasource and read_mcap() since it was redundant with topics parameter
- Both channels and topics did the same thing (filter by topic names)
- Simplified the API to only use topics parameter which aligns with MCAP's native filtering
- Updated all documentation, examples, and tests to use topics instead of channels
- Fixed import pattern to use 'import mcap' instead of 'from mcap.reader import make_reader' to avoid redundant import after _check_import

Signed-off-by: soffer-anyscale <[email protected]>
Signed-off-by: Richard Liaw <[email protected]>
Signed-off-by: Richard Liaw <[email protected]>
Signed-off-by: Richard Liaw <[email protected]>
Signed-off-by: Richard Liaw <[email protected]>
cursor[bot]

This comment was marked as outdated.

Signed-off-by: Richard Liaw <[email protected]>
@richardliaw richardliaw added the go add ONLY when ready to merge, run all tests label Oct 11, 2025
@richardliaw richardliaw self-assigned this Oct 11, 2025
@richardliaw
richardliaw merged commit 6320275 into master Oct 11, 2025
@richardliaw
richardliaw deleted the data_mcap branch October 11, 2025 02:35
ArturNiederfahrenhorst pushed a commit to ArturNiederfahrenhorst/ray that referenced this pull request Oct 13, 2025
xinyuangui2 pushed a commit to xinyuangui2/ray that referenced this pull request Oct 22, 2025
snorkelopstesting4-web pushed a commit to snorkel-marlin-repos/ray-project_ray_pr_55716_113abc5d-3cd4-4ff9-a977-dce77e71adf2 that referenced this pull request Oct 22, 2025
Original PR #55716 by soffer-anyscale
Original: ray-project/ray#55716
snorkelopstesting3-bot added a commit to snorkel-marlin-repos/ray-project_ray_pr_55716_113abc5d-3cd4-4ff9-a977-dce77e71adf2 that referenced this pull request Oct 22, 2025
elliot-barn pushed a commit that referenced this pull request Oct 23, 2025
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
Future-Outlier pushed a commit to Future-Outlier/ray that referenced this pull request Dec 7, 2025
richardliaw pushed a commit that referenced this pull request Sep 9, 2026
…65914)

## Description

`python/ray/data/tests/datasource/test_mcap.py` guards its whole module
with
`pytestmark = skipif(not MCAP_AVAILABLE)`, and `mcap` appears in no
requirements file
anywhere in the repo. `//python/ray/data:test_mcap` has therefore
reported success
since the datasource landed in #55716 without executing a single one of
its 18 tests.

This PR adds `mcap` to
`python/requirements/ml/data-test-requirements.txt` — the file
consumed by the Data CI image (`ci/env/install-dependencies.sh:303`,
`ci/ci.sh:60`) and
by `ci/raydepsets/configs/ci_data.depsets.yaml:19` — and regenerates the
locks that
depend on it.

## Related issues

Related to #65912, which fixes `estimate_inmemory_data_size` for this
datasource. The
two PRs are independent: both carry the identical one-line fix to
`test_read_mcap_invalid_time_range`, deliberately, so neither blocks the
other. Being
byte-identical, whichever lands second should rebase without a conflict.

Related to #61222 (audit and refactor file-based datasource tests),
which covers
adjacent ground but not this.

## Additional information

### What turning the tests on exposed

Three defects were sitting behind that skip. Each is fixed in its own
commit here,
because without them the target goes red on its first real run:

1. **`test_read_mcap_invalid_time_range` can never pass.** It searches
for
   `"start_time must be less than end_time"`; the code raises
`"start_time (2000) must be less than end_time (1000)"`. Fails on
unmodified master.

2. **`_should_include_message` and `_message_to_dict` annotate `schema`
as a bare
   `Schema`,** but `McapReader.iter_messages()` yields
`Tuple[Optional[Schema], Channel, Message]` — a channel may declare no
schema. Both
bodies already guard with `if schema else None`, so this is an
annotation fix only.
It was invisible while `mcap` was absent: pyrefly could not resolve
`mcap.reader`,
treated the return as `Any`, and reported nothing. With the package
installed its
`py.typed` annotations apply and `ci/lint/pyrefly-check.sh` fails on the
two
   pre-existing call sites in `_read_stream`.

3. **`python/requirements_compiled.txt` was missing `mcap`.** That file
is a separate
lock from `python/deplocks/`, compiled by `compile_pip_dependencies` in
`ci/ci.sh`
   from an input list that includes `data-test-requirements.txt`.

### The dependency itself costs the image nothing

The regenerated locks introduce exactly one package:

```
mcap==1.4.0 \
    --hash=sha256:0528e2f86a61bfec73779e0628e6cf27af83d01d89e20b27d5ec9f0b556a63ac \
    --hash=sha256:0b48b1cc951b8d5aabd2599e60d410bae4f1be1819094f54117b7cbf6b3ee2e9
    # via -r python/requirements/ml/data-test-requirements.txt
```

mcap's own dependencies, `lz4` and `zstandard`, are already present via
`clickhouse-connect`, `dask`, `ray` and `pyiceberg`. Every other changed
line across the
ten `python/deplocks/ci/*.lock` files and `requirements_compiled.txt` is
a `# via`
comment recording mcap as a new consumer.

### How the locks were produced

`python/deplocks/*.lock` with the repo's own tooling, using the same
command the
`raydepsets: compile all dependencies` job runs:

```
bazelisk run //ci/raydepsets:raydepsets -- build --all-configs
bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check
# Lock files are up to date.
```

`python/requirements_compiled.txt` could not be regenerated locally:
`compile_pip_dependencies` returns early on arm64 (`ci/ci.sh:20-27`).
Its four added
lines were reconstructed from the `dependencies` job's own diff and land
at the exact
line numbers it reported — mcap at 1093–1094, zstandard's `# via` entry
at 2712.

**Worth knowing for anyone adding a dependency here:** the two lock
systems are coupled
through a symlink. `python/requirements_compiled_py3.10` … `py3.13` are
all symlinks to
`requirements_compiled.txt` (only `py3.14` is a real file), and
`ci/raydepsets/pre_hooks/remove-compiled-headers.sh` copies
`python/requirements_compiled_py3.13.txt` into `/tmp/ray-deps/`, where
it becomes the
constraint the data depsets compile against. So adding a package to
`requirements_compiled.txt` changes the `# via` provenance recorded in
`python/deplocks/ci/*.lock` — uv then lists the package as coming from
both the
constraint and `data-test-requirements.txt`. Regenerating one lock
system without the
other leaves the tree inconsistent, which is why this PR has a separate
commit for it.

### Tests

With `mcap` installed on unmodified master, the previously-skipped
module runs and one
test fails — what the target would have been reporting all along:

```
1 failed, 17 passed in 15.50s
FAILED test_read_mcap_invalid_time_range
E   AssertionError: Regex pattern did not match.
E    Regex: 'start_time must be less than end_time'
E    Input: 'start_time (2000) must be less than end_time (1000)'
```

With the fixes in this PR:

```
PYTHONPATH=python/ray/data/tests python -u -m pytest \
    python/ray/data/tests/datasource/test_mcap.py -v
18 passed in 10.95s
```

pyrefly, run exactly as `ci/lint/pyrefly-check.sh` does, reports no
errors in
`mcap_datasource.py`. Lint hooks `black`, `ruff`, `pydoclint`,
`docstyle`, `check-ast`,
`check-import-order`, `trailing-whitespace` and `end-of-file-fixer` all
pass on the
changed files.

`size = "small"` is left as-is: the 18 tests take ~11s, and `test_json`
is `small` with
58 tests, so the 60-second budget has ample headroom.

---

AI assistance (Claude) was used for this change. I reviewed every
changed line and ran
the commands above locally.

---------

Signed-off-by: Marwan Sarieddine <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
NightWing1998 pushed a commit to NightWing1998/ray that referenced this pull request Sep 11, 2026
…ay-project#65914)

## Description

`python/ray/data/tests/datasource/test_mcap.py` guards its whole module
with
`pytestmark = skipif(not MCAP_AVAILABLE)`, and `mcap` appears in no
requirements file
anywhere in the repo. `//python/ray/data:test_mcap` has therefore
reported success
since the datasource landed in ray-project#55716 without executing a single one of
its 18 tests.

This PR adds `mcap` to
`python/requirements/ml/data-test-requirements.txt` — the file
consumed by the Data CI image (`ci/env/install-dependencies.sh:303`,
`ci/ci.sh:60`) and
by `ci/raydepsets/configs/ci_data.depsets.yaml:19` — and regenerates the
locks that
depend on it.

## Related issues

Related to ray-project#65912, which fixes `estimate_inmemory_data_size` for this
datasource. The
two PRs are independent: both carry the identical one-line fix to
`test_read_mcap_invalid_time_range`, deliberately, so neither blocks the
other. Being
byte-identical, whichever lands second should rebase without a conflict.

Related to ray-project#61222 (audit and refactor file-based datasource tests),
which covers
adjacent ground but not this.

## Additional information

### What turning the tests on exposed

Three defects were sitting behind that skip. Each is fixed in its own
commit here,
because without them the target goes red on its first real run:

1. **`test_read_mcap_invalid_time_range` can never pass.** It searches
for
   `"start_time must be less than end_time"`; the code raises
`"start_time (2000) must be less than end_time (1000)"`. Fails on
unmodified master.

2. **`_should_include_message` and `_message_to_dict` annotate `schema`
as a bare
   `Schema`,** but `McapReader.iter_messages()` yields
`Tuple[Optional[Schema], Channel, Message]` — a channel may declare no
schema. Both
bodies already guard with `if schema else None`, so this is an
annotation fix only.
It was invisible while `mcap` was absent: pyrefly could not resolve
`mcap.reader`,
treated the return as `Any`, and reported nothing. With the package
installed its
`py.typed` annotations apply and `ci/lint/pyrefly-check.sh` fails on the
two
   pre-existing call sites in `_read_stream`.

3. **`python/requirements_compiled.txt` was missing `mcap`.** That file
is a separate
lock from `python/deplocks/`, compiled by `compile_pip_dependencies` in
`ci/ci.sh`
   from an input list that includes `data-test-requirements.txt`.

### The dependency itself costs the image nothing

The regenerated locks introduce exactly one package:

```
mcap==1.4.0 \
    --hash=sha256:0528e2f86a61bfec73779e0628e6cf27af83d01d89e20b27d5ec9f0b556a63ac \
    --hash=sha256:0b48b1cc951b8d5aabd2599e60d410bae4f1be1819094f54117b7cbf6b3ee2e9
    # via -r python/requirements/ml/data-test-requirements.txt
```

mcap's own dependencies, `lz4` and `zstandard`, are already present via
`clickhouse-connect`, `dask`, `ray` and `pyiceberg`. Every other changed
line across the
ten `python/deplocks/ci/*.lock` files and `requirements_compiled.txt` is
a `# via`
comment recording mcap as a new consumer.

### How the locks were produced

`python/deplocks/*.lock` with the repo's own tooling, using the same
command the
`raydepsets: compile all dependencies` job runs:

```
bazelisk run //ci/raydepsets:raydepsets -- build --all-configs
bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check
# Lock files are up to date.
```

`python/requirements_compiled.txt` could not be regenerated locally:
`compile_pip_dependencies` returns early on arm64 (`ci/ci.sh:20-27`).
Its four added
lines were reconstructed from the `dependencies` job's own diff and land
at the exact
line numbers it reported — mcap at 1093–1094, zstandard's `# via` entry
at 2712.

**Worth knowing for anyone adding a dependency here:** the two lock
systems are coupled
through a symlink. `python/requirements_compiled_py3.10` … `py3.13` are
all symlinks to
`requirements_compiled.txt` (only `py3.14` is a real file), and
`ci/raydepsets/pre_hooks/remove-compiled-headers.sh` copies
`python/requirements_compiled_py3.13.txt` into `/tmp/ray-deps/`, where
it becomes the
constraint the data depsets compile against. So adding a package to
`requirements_compiled.txt` changes the `# via` provenance recorded in
`python/deplocks/ci/*.lock` — uv then lists the package as coming from
both the
constraint and `data-test-requirements.txt`. Regenerating one lock
system without the
other leaves the tree inconsistent, which is why this PR has a separate
commit for it.

### Tests

With `mcap` installed on unmodified master, the previously-skipped
module runs and one
test fails — what the target would have been reporting all along:

```
1 failed, 17 passed in 15.50s
FAILED test_read_mcap_invalid_time_range
E   AssertionError: Regex pattern did not match.
E    Regex: 'start_time must be less than end_time'
E    Input: 'start_time (2000) must be less than end_time (1000)'
```

With the fixes in this PR:

```
PYTHONPATH=python/ray/data/tests python -u -m pytest \
    python/ray/data/tests/datasource/test_mcap.py -v
18 passed in 10.95s
```

pyrefly, run exactly as `ci/lint/pyrefly-check.sh` does, reports no
errors in
`mcap_datasource.py`. Lint hooks `black`, `ruff`, `pydoclint`,
`docstyle`, `check-ast`,
`check-import-order`, `trailing-whitespace` and `end-of-file-fixer` all
pass on the
changed files.

`size = "small"` is left as-is: the 18 tests take ~11s, and `test_json`
is `small` with
58 tests, so the 60-second budget has ample headroom.

---

AI assistance (Claude) was used for this change. I reviewed every
changed line and ran
the commands above locally.

---------

Signed-off-by: Marwan Sarieddine <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ay-project#65914)

## Description

`python/ray/data/tests/datasource/test_mcap.py` guards its whole module
with
`pytestmark = skipif(not MCAP_AVAILABLE)`, and `mcap` appears in no
requirements file
anywhere in the repo. `//python/ray/data:test_mcap` has therefore
reported success
since the datasource landed in ray-project#55716 without executing a single one of
its 18 tests.

This PR adds `mcap` to
`python/requirements/ml/data-test-requirements.txt` — the file
consumed by the Data CI image (`ci/env/install-dependencies.sh:303`,
`ci/ci.sh:60`) and
by `ci/raydepsets/configs/ci_data.depsets.yaml:19` — and regenerates the
locks that
depend on it.

## Related issues

Related to ray-project#65912, which fixes `estimate_inmemory_data_size` for this
datasource. The
two PRs are independent: both carry the identical one-line fix to
`test_read_mcap_invalid_time_range`, deliberately, so neither blocks the
other. Being
byte-identical, whichever lands second should rebase without a conflict.

Related to ray-project#61222 (audit and refactor file-based datasource tests),
which covers
adjacent ground but not this.

## Additional information

### What turning the tests on exposed

Three defects were sitting behind that skip. Each is fixed in its own
commit here,
because without them the target goes red on its first real run:

1. **`test_read_mcap_invalid_time_range` can never pass.** It searches
for
   `"start_time must be less than end_time"`; the code raises
`"start_time (2000) must be less than end_time (1000)"`. Fails on
unmodified master.

2. **`_should_include_message` and `_message_to_dict` annotate `schema`
as a bare
   `Schema`,** but `McapReader.iter_messages()` yields
`Tuple[Optional[Schema], Channel, Message]` — a channel may declare no
schema. Both
bodies already guard with `if schema else None`, so this is an
annotation fix only.
It was invisible while `mcap` was absent: pyrefly could not resolve
`mcap.reader`,
treated the return as `Any`, and reported nothing. With the package
installed its
`py.typed` annotations apply and `ci/lint/pyrefly-check.sh` fails on the
two
   pre-existing call sites in `_read_stream`.

3. **`python/requirements_compiled.txt` was missing `mcap`.** That file
is a separate
lock from `python/deplocks/`, compiled by `compile_pip_dependencies` in
`ci/ci.sh`
   from an input list that includes `data-test-requirements.txt`.

### The dependency itself costs the image nothing

The regenerated locks introduce exactly one package:

```
mcap==1.4.0 \
    --hash=sha256:0528e2f86a61bfec73779e0628e6cf27af83d01d89e20b27d5ec9f0b556a63ac \
    --hash=sha256:0b48b1cc951b8d5aabd2599e60d410bae4f1be1819094f54117b7cbf6b3ee2e9
    # via -r python/requirements/ml/data-test-requirements.txt
```

mcap's own dependencies, `lz4` and `zstandard`, are already present via
`clickhouse-connect`, `dask`, `ray` and `pyiceberg`. Every other changed
line across the
ten `python/deplocks/ci/*.lock` files and `requirements_compiled.txt` is
a `# via`
comment recording mcap as a new consumer.

### How the locks were produced

`python/deplocks/*.lock` with the repo's own tooling, using the same
command the
`raydepsets: compile all dependencies` job runs:

```
bazelisk run //ci/raydepsets:raydepsets -- build --all-configs
bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check
# Lock files are up to date.
```

`python/requirements_compiled.txt` could not be regenerated locally:
`compile_pip_dependencies` returns early on arm64 (`ci/ci.sh:20-27`).
Its four added
lines were reconstructed from the `dependencies` job's own diff and land
at the exact
line numbers it reported — mcap at 1093–1094, zstandard's `# via` entry
at 2712.

**Worth knowing for anyone adding a dependency here:** the two lock
systems are coupled
through a symlink. `python/requirements_compiled_py3.10` … `py3.13` are
all symlinks to
`requirements_compiled.txt` (only `py3.14` is a real file), and
`ci/raydepsets/pre_hooks/remove-compiled-headers.sh` copies
`python/requirements_compiled_py3.13.txt` into `/tmp/ray-deps/`, where
it becomes the
constraint the data depsets compile against. So adding a package to
`requirements_compiled.txt` changes the `# via` provenance recorded in
`python/deplocks/ci/*.lock` — uv then lists the package as coming from
both the
constraint and `data-test-requirements.txt`. Regenerating one lock
system without the
other leaves the tree inconsistent, which is why this PR has a separate
commit for it.

### Tests

With `mcap` installed on unmodified master, the previously-skipped
module runs and one
test fails — what the target would have been reporting all along:

```
1 failed, 17 passed in 15.50s
FAILED test_read_mcap_invalid_time_range
E   AssertionError: Regex pattern did not match.
E    Regex: 'start_time must be less than end_time'
E    Input: 'start_time (2000) must be less than end_time (1000)'
```

With the fixes in this PR:

```
PYTHONPATH=python/ray/data/tests python -u -m pytest \
    python/ray/data/tests/datasource/test_mcap.py -v
18 passed in 10.95s
```

pyrefly, run exactly as `ci/lint/pyrefly-check.sh` does, reports no
errors in
`mcap_datasource.py`. Lint hooks `black`, `ruff`, `pydoclint`,
`docstyle`, `check-ast`,
`check-import-order`, `trailing-whitespace` and `end-of-file-fixer` all
pass on the
changed files.

`size = "small"` is left as-is: the 18 tests take ~11s, and `test_json`
is `small` with
58 tests, so the 60-second budget has ample headroom.

---

AI assistance (Claude) was used for this change. I reviewed every
changed line and ran
the commands above locally.

---------

Signed-off-by: Marwan Sarieddine <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants