Skip to content

Conversation

@XiaoHongbo-Hope
Copy link
Contributor

@XiaoHongbo-Hope XiaoHongbo-Hope commented Jan 14, 2026

Purpose

refactor file_io to support polymorphism instead of involve all the logic into one class.

Before:

  • FileIo
    • RestTokenFileIo

After:

  • FileIo
    • LocalFileIo
    • PyArrowFileIO
    • RESTTokenFileIO

Tests

API and Format

Documentation

@XiaoHongbo-Hope XiaoHongbo-Hope marked this pull request as ready for review January 14, 2026 16:01
@XiaoHongbo-Hope XiaoHongbo-Hope marked this pull request as draft January 14, 2026 16:14
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title refactor file io [python] Refactor FileIO to interface and optimize RESTTokenFileIO Jan 14, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Refactor FileIO to interface and optimize RESTTokenFileIO [python] Refactor file_io to interface and optimize rest_token_file_io Jan 14, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Refactor file_io to interface and optimize rest_token_file_io [python] refactor file_io to interface and optimize rest_token_file_io Jan 14, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] refactor file_io to interface and optimize rest_token_file_io [python] refactor file_io to interface Jan 15, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] refactor file_io to interface [python] refactor file_io Jan 15, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] refactor file_io [python] refactor file_io to support polymorphism Jan 15, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope marked this pull request as ready for review January 15, 2026 06:02
self.filesystem = self._initialize_s3_fs()
elif scheme in {"hdfs", "viewfs"}:
self.filesystem = self._initialize_hdfs_fs(scheme, netloc)
elif scheme in {"file"}:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe local file system is not needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe local file system is not needed here.

removed


RENAME_LOCK = threading.Lock()

INSTANCE = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need INSTANCE variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need INSTANCE variable?

removed

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