Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:return: True - upload unsuccessful; False - upload successful
"""
if not quiet:
print('Starting upload for file ' + file_name)
content_length = os.path.getsize(full_path)
token = self.dataset_upload_file(full_path, quiet)
if token is None:
if not quiet:
print('Upload unsuccessful: ' + file_name)
return True
if not quiet:
print('Upload successful: ' + file_name + ' (' +
File.get_size(content_length) + ')')
upload_file = DatasetUploadFile()
upload_file.token = token
if resources:
for item in resources:
if file_name == item.get('path'):
upload_file.description = item.get('description')
if 'schema' in item:
fields = self.get_or_default(item['schema'], 'fields',
[])
processed = []
count = 0
for field in fields:
processed.append(self.process_column(field))
processed[count].order = count
count += 1
upload_file.columns = processed
request.files.append(upload_file)
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DatasetUploadFile):
return False
return self.__dict__ == other.__dict__