Skip to content

Conversation

@kkim-labelbox
Copy link
Contributor

  • Fixed metadata not uploading when data row is a local file
  • Added test cases

Comment on lines +263 to +266
item['row_data'] = item_url
if 'external_id' not in item:
# Default `external_id` to local file name
item['external_id'] = row_data
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this different?

Copy link
Contributor Author

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

Copy link
Contributor

@msokoloff1 msokoloff1 Jul 26, 2022

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

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'])
Copy link
Contributor

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)

@msokoloff1 msokoloff1 self-requested a review July 26, 2022 19:35
@kkim-labelbox kkim-labelbox merged commit 724dd58 into develop Jul 26, 2022
@jtsodapop jtsodapop deleted the kkim/AL-2996 branch September 14, 2022 15: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.

4 participants