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
File.from_stream does not load content into memory #1065
Conversation
@@ -235,7 +235,7 @@ def test_get_html_from_bokeh(self): | |||
result = get_html_content(p) | |||
|
|||
# then | |||
self.assertTrue(result.startswith('<!DOCTYPE html>\n<html lang="en">')) | |||
self.assertTrue(result.lstrip().startswith('<!DOCTYPE html>\n<html lang="en">')) |
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.
Pibbyback fixing test which always fails on my local Ubuntu.
self, | ||
path: Optional[str] = None, | ||
content: Optional[bytes] = None, | ||
extension: Optional[str] = None, |
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.
Yes, @Herudaio accepted removing extension
from this init
.
src/neptune/new/types/atoms/file.py
Outdated
|
||
@staticmethod | ||
def from_stream(stream: IOBase, seek: Optional[int] = 0, extension: Optional[str] = None) -> "File": | ||
# TODO: docs (update) |
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.
We could inform user that from now on, he will be able to use file created with File.from_stream
at most once.
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.
d0554c1
to
b2d0002
Compare
@@ -0,0 +1,170 @@ | |||
# |
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.
Remove all these _
prefixes and move it to internal
package. Everything that is outside of internal
should be treated as a user-exposed
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.
Good point.
fa0beac
to
97c822f
Compare
src/neptune/internal/file_types.py
Outdated
@@ -0,0 +1,173 @@ | |||
# |
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.
Huh? Why inside of neptune.internal
instead of neptune.new.internal
?
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.
My bad, fixing
d2dd2c3
to
6fcf1d2
Compare
No description provided.