-
Notifications
You must be signed in to change notification settings - Fork 64
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
Upload in-memory files using copy stored on disk #1052
Conversation
4e5021b
to
32986ed
Compare
@@ -29,6 +30,10 @@ class OperationStorage: | |||
def __init__(self, data_path: str): | |||
self._data_path = Path(data_path) | |||
|
|||
# initialize directories | |||
os.makedirs(self.data_path) |
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.
Maybe with exist_ok=True
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.
Definitelly, good catch!
def get_upload_path(attribute_path: List[str], extension: str, upload_path: Path): | ||
now = datetime.now() | ||
tmp_file_name = f"{'_'.join(attribute_path)}-{now.timestamp()}-{now}.{extension}" | ||
tmp_file_name = tmp_file_name.replace(" ", "_").replace(":", ".") |
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.
What about just proper strftime()
instead of these bad looking replace calls?
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.
I've used to copy-paste this code over and over...
Yes, it's better idea ;)
No description provided.