Пример #1
0
def from_manifest(manifest, destination, **ingestion_args):
    '''From a dict that can be jsonified and uploaded to S3. For more info on manifests,
       see http://docs.aws.amazon.com/redshift/latest/dg/loading-data-files-using-manifest.html'''
    s3_path = _transient_s3_path(destination) + '.manifest'
    s3_manifest = S3File.from_json_serializable(manifest, s3_path)

    s3_to_redshift(s3_manifest, destination, with_manifest=True, **ingestion_args)
Пример #2
0
    def test_dictionary_becomes_json_file_in_s3(self):
        file = S3File.from_json_serializable(data=self.DATA,
                                             s3_path=self.S3_PATH)

        temp_path = file.download_to_temp()
        with open(temp_path) as file:
            actual_data = json.load(file)
        self.assertEqual(actual_data, self.DATA)