-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
refactor: rename FileStream.file_reader to file_opener & update doc #8883
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution @SteveLauC - looks like a nice improvement to me.
@@ -269,7 +267,7 @@ impl<F: FileOpener> FileStream<F> { | |||
file_iter: files.into(), | |||
projected_schema, | |||
remain: config.limit, | |||
file_reader, | |||
file_opener: file_reader, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you can change the name of the parameter to this function to file_opener
to match the field name too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed this one:D
/// is not capable of limiting the number of records in the last batch, the file | ||
/// stream will take care of truncating it. | ||
file_reader: F, | ||
/// A generic file opener, calling `open()` on it will return a `FileOpenFuture`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A generic file opener, calling `open()` on it will return a `FileOpenFuture`, | |
/// A generic [`FileOpener`]/ Calling `open()` returns a [`FileOpenFuture`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Though I changed that /
to a .
369b7a1
to
4e7e0e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @SteveLauC
Which issue does this PR close?
Can be seen as a fix to #2990.
Rationale for this change
The
FileStream.file_reader
field is a generic type that implements theFileOpener
trait, so it is kinda confusing to call itfile_reader
rather thanfile_opener
.#2291 tried to do some naming refactoring to this file, but it seems that @tustvold forgot to update this field name I guess?
And that doc comment was added in #1138, which is quite old and outdated.
What changes are included in this PR?
FileStream.file_reader
toFileStream.file_opener
.Are these changes tested?
No
Are there any user-facing changes?
This field is private so I guess no.