diff --git a/python/ray/data/_internal/datasource/mcap_datasource.py b/python/ray/data/_internal/datasource/mcap_datasource.py index 29995cf78ba4..b4ae4fdf90a5 100644 --- a/python/ray/data/_internal/datasource/mcap_datasource.py +++ b/python/ray/data/_internal/datasource/mcap_datasource.py @@ -139,9 +139,9 @@ def _read_stream(self, f: "pyarrow.NativeFile", path: str) -> Iterator[Block]: Raises: ValueError: If the MCAP file cannot be read or has invalid format. """ - import mcap + from mcap.reader import make_reader - reader = mcap.reader.make_reader(f) + reader = make_reader(f) # Note: MCAP summaries are optional and iter_messages works without them # We don't need to validate the summary since it's not required