Skip to content

Conversation

@umangbudhwar
Copy link

@umangbudhwar umangbudhwar commented Jun 5, 2025

Which issue is this PR linked to?

This PR is in continuation of the discussion [#24].

What changes are included in this PR?

  • Support for the below methods:

    • _fetch_range
    • _initiate_upload
    • _commit_upload
    • close
  • Added test cases

  • Minor fixes to linting

@umangbudhwar umangbudhwar marked this pull request as ready for review June 6, 2025 14:05
@umangbudhwar
Copy link
Author

Hi @Xuanwo, could you please take a look when you get a chance and share your feedback?

Copy link
Collaborator

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thank you for working on this!

def _fetch_range(self, start: int, end: int) -> bytes:
"""Download data between start and end."""
logger.debug(f"Fetching bytes from {start} to {end} for {self.path}")
data = self.fs.fs.read(self.path) # sync operator
Copy link
Collaborator

Choose a reason for hiding this comment

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

We now have native support for read(self.path, offset, size) after apache/opendal#6086 was merged. Would you like to create an issue to track this, so we can update our usage and avoid reading the entire file?

Copy link
Author

@umangbudhwar umangbudhwar Jun 9, 2025

Choose a reason for hiding this comment

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

#28 Created the issue

def _commit_upload(self) -> None:
"""Ensure upload is complete"""
pass
"""Write the full buffer to the backend once"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

OpenDAL has it's own buffer, so we just need to implement write for OpendalBufferedFile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants