-
Notifications
You must be signed in to change notification settings - Fork 383
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
documents uploads will use HDFSfileUploadHandler when task_server is on #4044
base: master
Are you sure you want to change the base?
Conversation
|
Backend Code Coverage Report •
Pytest Report
|
4794086
to
d828228
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.
Nice change! I've left few review comments.
Also can you add unit tests please?
|
||
def __init__(self, request, *args, **kwargs): | ||
super().__init__(request, *args, **kwargs) | ||
if request.path.startswith("/desktop/api2/doc/import"): |
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.
Try using reverse()
instead of hardcoding here?
self.delegate = HDFSfileUploadHandler(request) | ||
else: | ||
self.delegate = FineUploaderChunkedUploadHandler(request, *args, **kwargs) |
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.
Nit: Better variable naming? Something related to upload handler?
What changes were proposed in this pull request?
Import documents in documents tab are failing, when task server is enabled with error
" File "/opt/hive/desktop/core/src/desktop/api2.py", line 1027, in import_documents
raise PopupException(_('Failed to import documents, the file does not contain valid JSON.'))".
This was because the document upload handler was using
FineUploaderChunkedUploadHandler
when theis_chunked_fileuploader_enabled
flag is on. No supporting logic was added toFineUploaderChunkedUploadHandler
to support document uploads as the main motive ofFineUploaderChunkedUploadHandler
was to support large file uploads.So adding a custom upload handler that will delegate the document upload tasks to the
HDFSfileUploadHandler
and rest of the file uploads toFineUploaderChunkedUploadHandler
whenis_chunked_fileuploader_enabled
is on.How was this patch tested?
-tested local setup and Kubernetes setup
Please review Hue Contributing Guide before opening a pull request.