Skip to content

Commit 0002fe6

Browse files
authored
Merge pull request #187 from awslabs/s3-copy
Add s3.copy_objects()
2 parents 3e58fa3 + 30f3ea0 commit 0002fe6

File tree

8 files changed

+798
-26
lines changed

8 files changed

+798
-26
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ df = wr.db.read_sql_query("SELECT * FROM external_schema.my_table", con=engine)
8484
- [10 - Parquet Crawler](https://github.com/awslabs/aws-data-wrangler/blob/master/tutorials/10%20-%20Parquet%20Crawler.ipynb)
8585
- [11 - CSV Datasets](https://github.com/awslabs/aws-data-wrangler/blob/master/tutorials/11%20-%20CSV%20Datasets.ipynb)
8686
- [12 - CSV Crawler](https://github.com/awslabs/aws-data-wrangler/blob/master/tutorials/12%20-%20CSV%20Crawler.ipynb)
87+
- [13 - Merging Datasets on S3](https://github.com/awslabs/aws-data-wrangler/blob/master/tutorials/13%20-%20Merging%20Datasets%20on%20S3.ipynb)
8788
- [**API Reference**](https://aws-data-wrangler.readthedocs.io/en/latest/api.html)
8889
- [Amazon S3](https://aws-data-wrangler.readthedocs.io/en/latest/api.html#amazon-s3)
8990
- [AWS Glue Catalog](https://aws-data-wrangler.readthedocs.io/en/latest/api.html#aws-glue-catalog)

awswrangler/_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ def client(service_name: str, session: Optional[boto3.Session] = None) -> boto3.
2828
)
2929

3030

31+
def resource(service_name: str, session: Optional[boto3.Session] = None) -> boto3.resource:
32+
"""Create a valid boto3.resource."""
33+
return ensure_session(session=session).resource(
34+
service_name=service_name, use_ssl=True, config=botocore.config.Config(retries={"max_attempts": 15})
35+
)
36+
37+
3138
def parse_path(path: str) -> Tuple[str, str]:
3239
"""Split a full S3 path in bucket and key strings.
3340
@@ -62,7 +69,7 @@ def ensure_cpu_count(use_threads: bool = True) -> int:
6269
6370
Note
6471
----
65-
In case of `use_threads=True` the number of process that could be spawned will be get from os.cpu_count().
72+
In case of `use_threads=True` the number of threads that could be spawned will be get from os.cpu_count().
6673
6774
Parameters
6875
----------

awswrangler/athena.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def read_sql_query( # pylint: disable=too-many-branches,too-many-locals
369369
370370
Note
371371
----
372-
In case of `use_threads=True` the number of process that will be spawned will be get from os.cpu_count().
372+
In case of `use_threads=True` the number of threads that will be spawned will be get from os.cpu_count().
373373
374374
Parameters
375375
----------
@@ -605,7 +605,7 @@ def read_sql_table(
605605
606606
Note
607607
----
608-
In case of `use_threads=True` the number of process that will be spawned will be get from os.cpu_count().
608+
In case of `use_threads=True` the number of threads that will be spawned will be get from os.cpu_count().
609609
610610
Parameters
611611
----------

awswrangler/db.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def copy_to_redshift( # pylint: disable=too-many-arguments
438438
439439
Note
440440
----
441-
In case of `use_threads=True` the number of process that will be spawned will be get from os.cpu_count().
441+
In case of `use_threads=True` the number of threads that will be spawned will be get from os.cpu_count().
442442
443443
Parameters
444444
----------
@@ -576,7 +576,7 @@ def copy_files_to_redshift( # pylint: disable=too-many-locals,too-many-argument
576576
577577
Note
578578
----
579-
In case of `use_threads=True` the number of process that will be spawned will be get from os.cpu_count().
579+
In case of `use_threads=True` the number of threads that will be spawned will be get from os.cpu_count().
580580
581581
Parameters
582582
----------
@@ -798,7 +798,7 @@ def write_redshift_copy_manifest(
798798
799799
Note
800800
----
801-
In case of `use_threads=True` the number of process that will be spawned will be get from os.cpu_count().
801+
In case of `use_threads=True` the number of threads that will be spawned will be get from os.cpu_count().
802802
803803
Parameters
804804
----------
@@ -908,7 +908,7 @@ def unload_redshift(
908908
909909
Note
910910
----
911-
In case of `use_threads=True` the number of process that will be spawned will be get from os.cpu_count().
911+
In case of `use_threads=True` the number of threads that will be spawned will be get from os.cpu_count().
912912
913913
Parameters
914914
----------
@@ -1024,7 +1024,7 @@ def unload_redshift_to_files(
10241024
10251025
Note
10261026
----
1027-
In case of `use_threads=True` the number of process that will be spawned will be get from os.cpu_count().
1027+
In case of `use_threads=True` the number of threads that will be spawned will be get from os.cpu_count().
10281028
10291029
Parameters
10301030
----------

0 commit comments

Comments
 (0)