Skip to content

Conversation

@ddey2
Copy link
Member

@ddey2 ddey2 commented Aug 16, 2023

fixes to dataset.py to make dataset extractor working.

To test, please run test-dataset-extractor from clowder-framework/pyclowder#67

Trigger it on any dataset.

@ddey2 ddey2 requested a review from max-zilla as a code owner August 16, 2023 03:24
@ddey2 ddey2 linked an issue Aug 16, 2023 that may be closed by this pull request
tcnichol and others added 10 commits August 16, 2023 12:26
the method for save_file used get_current_user rather than get_user, which was causing the error with using an API key instead of the token.
i think this fixes the issue with file upload, but not sure whether it will cause any other changes.
uploaded by mmistake
…dataset-extractor

# Conflicts:
#	frontend/package-lock.json
@longshuicy
Copy link
Member

So the key issue is "token" no longer needed since it's handled by dependencies?

@tcnichol
Copy link
Contributor

Yes.

There was a dependency for Security that we no longer use that only works with token, but not API key. It was removed in other routes but was still in the file upload.

Token was used in methods but, in the end, wasn't used in the last one, so I removed it. The user info is still used with rabbitmq and posting the jobs.

Copy link
Contributor

@tcnichol tcnichol left a comment

Choose a reason for hiding this comment

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

Tested.

Works with the pyclowder branch, the file posts into the dataset now. Approved.

… with the method from mimetypes

also changed in visualization.
@tcnichol
Copy link
Contributor

I made 1 fix here based on the debugging from Friday.

Mimetypes.get_content_type was being given a io.FileBytesIO, but it needed the file name. So it now is sent the file name from the new_file File object that is created.

I tested and this still works with visualization.

Since I had it working I went ahead and pushed here while I remembered.

With the dataset extractor, the file that gets sent does have None for a filetype but this does correctly find the filetype from the filename and the entry is added in minio. When downloaded the file is the same now.

@ddey2
Copy link
Member Author

ddey2 commented Aug 21, 2023

@tcnichol Thanks. It needed one little change. Now everything is working.

Copy link
Contributor

@max-zilla max-zilla left a comment

Choose a reason for hiding this comment

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

tested with pyclowder PR extractor, merging both

@max-zilla max-zilla merged commit 155e8cd into main Aug 21, 2023
@max-zilla max-zilla deleted the fix-dataset-extractor branch August 21, 2023 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add visualization to dataset

5 participants