Esempio n. 1
0
    def upload_from_file(self, src, tar):
        '''upload a file to data lake
        src : source file path 
        tar : target file path, in data lake. 
        '''
        try:
            if self.on_cloud:
                GCS.upload_blob(self.bucket, src, tar)
            else:
                file_path = join(self.local_dir, tar)
                copy(src, file_path)

        except Exception as e:
            print('DataLakeConnector.upload_from_file(), error: {}'.format(e))