Skip to content

Commit 7757810

Browse files
committed
Bumping version to 1.5.0
1 parent e75dfa9 commit 7757810

File tree

15 files changed

+55
-49
lines changed

15 files changed

+55
-49
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
![AWS Data Wrangler](docs/source/_static/logo2.png?raw=true "AWS Data Wrangler")
55

6-
[![Release](https://img.shields.io/badge/release-1.4.0-brightgreen.svg)](https://pypi.org/project/awswrangler/)
6+
[![Release](https://img.shields.io/badge/release-1.5.0-brightgreen.svg)](https://pypi.org/project/awswrangler/)
77
[![Python Version](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-brightgreen.svg)](https://anaconda.org/conda-forge/awswrangler)
88
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
99
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
1010

1111
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
12-
[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)](https://pypi.org/project/awswrangler/)
12+
[![Coverage](https://img.shields.io/badge/coverage-90%25-brightgreen.svg)](https://pypi.org/project/awswrangler/)
1313
![Static Checking](https://github.com/awslabs/aws-data-wrangler/workflows/Static%20Checking/badge.svg?branch=master)
1414
[![Documentation Status](https://readthedocs.org/projects/aws-data-wrangler/badge/?version=latest)](https://aws-data-wrangler.readthedocs.io/?badge=latest)
1515

awswrangler/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
66
"""
77

8-
import logging
8+
import logging as _logging
99

1010
from awswrangler import athena, catalog, cloudwatch, db, emr, exceptions, quicksight, s3 # noqa
1111
from awswrangler.__metadata__ import __description__, __license__, __title__, __version__ # noqa
1212
from awswrangler._utils import get_account_id # noqa
1313

14-
logging.getLogger("awswrangler").addHandler(logging.NullHandler())
14+
_logging.getLogger("awswrangler").addHandler(_logging.NullHandler())

awswrangler/__metadata__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
__title__ = "awswrangler"
99
__description__ = "Pandas on AWS."
10-
__version__ = "1.4.0"
10+
__version__ = "1.5.0"
1111
__license__ = "Apache License 2.0"

awswrangler/catalog.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import re
77
import unicodedata
88
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
9-
from urllib.parse import quote_plus
9+
from urllib.parse import quote_plus as _quote_plus
1010

1111
import boto3 # type: ignore
1212
import pandas as pd # type: ignore
@@ -566,10 +566,12 @@ def get_tables(
566566
if catalog_id is not None:
567567
args["CatalogId"] = catalog_id
568568
if (name_prefix is not None) and (name_suffix is not None) and (name_contains is not None):
569-
raise exceptions.InvalidArgumentCombination("Please, does not filter using name_contains and "
570-
"name_prefix/name_suffix at the same time. Only "
571-
"name_prefix and name_suffix can be combined together.")
572-
elif (name_prefix is not None) and (name_suffix is not None):
569+
raise exceptions.InvalidArgumentCombination(
570+
"Please, does not filter using name_contains and "
571+
"name_prefix/name_suffix at the same time. Only "
572+
"name_prefix and name_suffix can be combined together."
573+
)
574+
if (name_prefix is not None) and (name_suffix is not None):
573575
args["Expression"] = f"{name_prefix}*{name_suffix}"
574576
elif name_contains is not None:
575577
args["Expression"] = f"*{name_contains}*"
@@ -665,7 +667,7 @@ def tables(
665667
if "Columns" in tbl["StorageDescriptor"]:
666668
df_dict["Columns"].append(", ".join([x["Name"] for x in tbl["StorageDescriptor"]["Columns"]]))
667669
else:
668-
df_dict["Columns"].append("")
670+
df_dict["Columns"].append("") # pragma: no cover
669671
if "PartitionKeys" in tbl:
670672
df_dict["Partitions"].append(", ".join([x["Name"] for x in tbl["PartitionKeys"]]))
671673
else:
@@ -1008,8 +1010,8 @@ def get_engine(
10081010
db_type: str = details["JDBC_CONNECTION_URL"].split(":")[1].lower()
10091011
host: str = details["JDBC_CONNECTION_URL"].split(":")[2].replace("/", "")
10101012
port, database = details["JDBC_CONNECTION_URL"].split(":")[3].split("/")
1011-
user: str = quote_plus(details["USERNAME"])
1012-
password: str = quote_plus(details["PASSWORD"])
1013+
user: str = _quote_plus(details["USERNAME"])
1014+
password: str = _quote_plus(details["PASSWORD"])
10131015
if db_type == "postgresql":
10141016
_utils.ensure_postgresql_casts()
10151017
if db_type in ("redshift", "postgresql"):

awswrangler/cloudwatch.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""CloudWatch Logs module."""
22

3+
import datetime
34
import logging
45
import time
5-
from datetime import datetime
66
from typing import Any, Dict, List, Optional
77

88
import boto3 # type: ignore
@@ -18,8 +18,8 @@
1818
def start_query(
1919
query: str,
2020
log_group_names: List[str],
21-
start_time: datetime = datetime(year=1970, month=1, day=1),
22-
end_time: datetime = datetime.now(),
21+
start_time: datetime.datetime = datetime.datetime(year=1970, month=1, day=1),
22+
end_time: datetime.datetime = datetime.datetime.now(),
2323
limit: Optional[int] = None,
2424
boto3_session: Optional[boto3.Session] = None,
2525
) -> str:
@@ -120,8 +120,8 @@ def wait_query(query_id: str, boto3_session: Optional[boto3.Session] = None) ->
120120
def run_query(
121121
query: str,
122122
log_group_names: List[str],
123-
start_time: datetime = datetime(year=1970, month=1, day=1),
124-
end_time: datetime = datetime.now(),
123+
start_time: datetime.datetime = datetime.datetime(year=1970, month=1, day=1),
124+
end_time: datetime.datetime = datetime.datetime.now(),
125125
limit: Optional[int] = None,
126126
boto3_session: Optional[boto3.Session] = None,
127127
) -> List[List[Dict[str, str]]]:
@@ -174,8 +174,8 @@ def run_query(
174174
def read_logs(
175175
query: str,
176176
log_group_names: List[str],
177-
start_time: datetime = datetime(year=1970, month=1, day=1),
178-
end_time: datetime = datetime.now(),
177+
start_time: datetime.datetime = datetime.datetime(year=1970, month=1, day=1),
178+
end_time: datetime.datetime = datetime.datetime.now(),
179179
limit: Optional[int] = None,
180180
boto3_session: Optional[boto3.Session] = None,
181181
) -> pd.DataFrame:

awswrangler/db.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55
import time
66
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
7-
from urllib.parse import quote_plus
7+
from urllib.parse import quote_plus as _quote_plus
88

99
import boto3 # type: ignore
1010
import pandas as pd # type: ignore
@@ -350,8 +350,8 @@ def get_redshift_temp_engine(
350350
res: Dict[str, Any] = client_redshift.get_cluster_credentials(
351351
DbUser=user, ClusterIdentifier=cluster_identifier, DurationSeconds=duration, AutoCreate=False
352352
)
353-
_user: str = quote_plus(res["DbUser"])
354-
password: str = quote_plus(res["DbPassword"])
353+
_user: str = _quote_plus(res["DbUser"])
354+
password: str = _quote_plus(res["DbPassword"])
355355
cluster: Dict[str, Any] = client_redshift.describe_clusters(ClusterIdentifier=cluster_identifier)["Clusters"][0]
356356
host: str = cluster["Endpoint"]["Address"]
357357
port: str = cluster["Endpoint"]["Port"]

awswrangler/quicksight/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
list_iam_policy_assignments_for_user,
4040
list_ingestions,
4141
list_templates,
42+
list_user_groups,
4243
list_users,
4344
)

awswrangler/quicksight/_create.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,10 @@ def create_athena_dataset(
275275
if ((database is None) and (table is None)) and (sql is None):
276276
raise exceptions.InvalidArgument("You must pass database/table OR sql argument.")
277277
if (database is not None) and (sql is not None):
278-
raise exceptions.InvalidArgument("If you provide sql argument, please include the database name inside the sql statement. Do NOT pass in with database argument.")
278+
raise exceptions.InvalidArgument(
279+
"If you provide sql argument, please include the database name inside the sql statement."
280+
"Do NOT pass in with database argument."
281+
)
279282
session: boto3.Session = _utils.ensure_session(session=boto3_session)
280283
client: boto3.client = _utils.client(service_name="quicksight", session=session)
281284
if account_id is None:

awswrangler/s3/_delete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Amazon S3 CopDeletey Module (PRIVATE)."""
22

33
import concurrent.futures
4+
import itertools
45
import logging
5-
from itertools import repeat
66
from typing import Dict, List, Optional, Union
77

88
import boto3 # type: ignore
@@ -82,4 +82,4 @@ def delete_objects(
8282
else:
8383
cpus: int = _utils.ensure_cpu_count(use_threads=use_threads)
8484
with concurrent.futures.ThreadPoolExecutor(max_workers=cpus) as executor:
85-
list(executor.map(_delete_objects, repeat(bucket), chunks, repeat(client_s3)))
85+
list(executor.map(_delete_objects, itertools.repeat(bucket), chunks, itertools.repeat(client_s3)))

awswrangler/s3/_describe.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Amazon S3 Describe Module (INTERNAL)."""
22

33
import concurrent.futures
4+
import itertools
45
import logging
56
import time
6-
from itertools import repeat
77
from typing import Any, Dict, List, Optional, Tuple, Union
88

99
import boto3 # type: ignore
@@ -94,7 +94,9 @@ def describe_objects(
9494
else:
9595
cpus: int = _utils.ensure_cpu_count(use_threads=use_threads)
9696
with concurrent.futures.ThreadPoolExecutor(max_workers=cpus) as executor:
97-
resp_list = list(executor.map(_describe_object, paths, repeat(wait_time), repeat(client_s3)))
97+
resp_list = list(
98+
executor.map(_describe_object, paths, itertools.repeat(wait_time), itertools.repeat(client_s3))
99+
)
98100
desc_dict: Dict[str, Dict[str, Any]] = dict(resp_list)
99101
return desc_dict
100102

0 commit comments

Comments
 (0)