Skip to content

Add arbitrary io buffer support to reader #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

seemanne
Copy link

@seemanne seemanne commented Aug 8, 2025

This PR closes #232

Went with the suggested method of defaulting the filename to f"< type >" if it doesn't exist. The test has to work around the workaround which is used to avoid having to open files manually, I added a comment on it to explain why it is needed.

@seemanne
Copy link
Author

seemanne commented Aug 8, 2025

I will fix the import order for the test file, on the complexity of the init function it would help to get some maintainer input before proceeding, disabling/increasing the value is not something I feel comfortable making a decision on for a driveby pr.

Edit: nvm I can just reduce the complexity ig

@seemanne seemanne force-pushed the ese-add-buffer-support branch from 4e4fb20 to 5ce419e Compare August 8, 2025 10:16
Copy link
Contributor

@horgh horgh left a comment

Choose a reason for hiding this comment

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

Looks good, thank you! I have one comment.

def _load_buffer(
self, database: AnyStr | int | PathLike | IO, mode: int = MODE_AUTO
) -> None:
self.filename: Any
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than making this a public attribute, what do you think about returning it from this function?

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

Successfully merging this pull request may close these issues.

Feature Request: Support arbitrary io buffers in open_database
2 participants