|
6 | 6 | import re |
7 | 7 | import unicodedata |
8 | 8 | 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 |
10 | 10 |
|
11 | 11 | import boto3 # type: ignore |
12 | 12 | import pandas as pd # type: ignore |
@@ -566,10 +566,12 @@ def get_tables( |
566 | 566 | if catalog_id is not None: |
567 | 567 | args["CatalogId"] = catalog_id |
568 | 568 | 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): |
573 | 575 | args["Expression"] = f"{name_prefix}*{name_suffix}" |
574 | 576 | elif name_contains is not None: |
575 | 577 | args["Expression"] = f"*{name_contains}*" |
@@ -665,7 +667,7 @@ def tables( |
665 | 667 | if "Columns" in tbl["StorageDescriptor"]: |
666 | 668 | df_dict["Columns"].append(", ".join([x["Name"] for x in tbl["StorageDescriptor"]["Columns"]])) |
667 | 669 | else: |
668 | | - df_dict["Columns"].append("") |
| 670 | + df_dict["Columns"].append("") # pragma: no cover |
669 | 671 | if "PartitionKeys" in tbl: |
670 | 672 | df_dict["Partitions"].append(", ".join([x["Name"] for x in tbl["PartitionKeys"]])) |
671 | 673 | else: |
@@ -1008,8 +1010,8 @@ def get_engine( |
1008 | 1010 | db_type: str = details["JDBC_CONNECTION_URL"].split(":")[1].lower() |
1009 | 1011 | host: str = details["JDBC_CONNECTION_URL"].split(":")[2].replace("/", "") |
1010 | 1012 | 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"]) |
1013 | 1015 | if db_type == "postgresql": |
1014 | 1016 | _utils.ensure_postgresql_casts() |
1015 | 1017 | if db_type in ("redshift", "postgresql"): |
|
0 commit comments