-
Notifications
You must be signed in to change notification settings - Fork 68
[AL-2996] Fix metadata uploads with local file datarow upload #647
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
Conversation
kkim-labelbox
commented
Jul 26, 2022
- Fixed metadata not uploading when data row is a local file
- Added test cases
| item['row_data'] = item_url | ||
| if 'external_id' not in item: | ||
| # Default `external_id` to local file name | ||
| item['external_id'] = row_data |
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.
How is this different?
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.
it uses the original item, and alters it, rather than constructing a brand new item
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 is the need for this? Or reasoning behind this change.
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.
oh sorry, I should have read the description.
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.
No worries, it's a subtle change haha
labelbox/schema/dataset.py
Outdated
| def upload_if_necessary(item): | ||
| row_data = item['row_data'] | ||
| if os.path.exists(row_data): | ||
| item_url = self.client.upload_file(item['row_data']) |
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.
suggestion can we change this item_url = self.client.upload_file(item['row_data']) to this?
item_url = self.client.upload_file(row_data)