Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def data_import_from_file(self, dataset_id, filepath,
update_method=UpdateMethod.REPLACE):
with open(os.path.expanduser(filepath), 'rb') as csvfile:
# passing an open file to the requests library invokes http
# streaming (uses minimal system memory)
self._data_import(dataset_id, csvfile, update_method)
def data_import(self, dataset_id, csv, update_method=UpdateMethod.REPLACE):
return self._data_import(dataset_id, str.encode(csv), update_method)