Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion awswrangler/athena/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _WorkGroupConfig(NamedTuple):

class _LocalMetadataCacheManager:
def __init__(self) -> None:
self._cache: Dict[str, Any] = dict()
self._cache: Dict[str, Any] = {}
self._pqueue: List[Tuple[datetime.datetime, str]] = []
self._max_cache_size = 100

Expand Down
2 changes: 1 addition & 1 deletion awswrangler/catalog/_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _check_column_type(column_type: str) -> bool:


def _update_table_definition(current_definition: Dict[str, Any]) -> Dict[str, Any]:
definition: Dict[str, Any] = dict()
definition: Dict[str, Any] = {}
keep_keys = [
"Name",
"Description",
Expand Down
2 changes: 1 addition & 1 deletion awswrangler/chime.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def post_message(webhook: str, message: str) -> Optional[Any]:
Represents the response from Chime
"""
response = None
chime_message = {"Content": "Message: %s" % (message)}
chime_message = {"Content": f"Message: {message}"}
req = Request(webhook, json.dumps(chime_message).encode("utf-8"))
try:
response = urlopen(req) # pylint: disable=R1732
Expand Down
2 changes: 1 addition & 1 deletion awswrangler/dynamodb/_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def put_json(
... )
"""
# Loading data from file
with open(path, "r") as f:
with open(path, "r") as f: # pylint: disable=W1514
items = json.load(f)
if isinstance(items, dict):
items = [items]
Expand Down
2 changes: 1 addition & 1 deletion awswrangler/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def connect(
attrs: _db_utils.ConnectionAttributes = _db_utils.get_connection_attributes(
connection=connection, secret_id=secret_id, catalog_id=catalog_id, dbname=dbname, boto3_session=boto3_session
)
if attrs.kind != "postgresql" and attrs.kind != "postgres":
if attrs.kind not in ("postgresql", "postgres"):
raise exceptions.InvalidDatabaseType(
f"Invalid connection type ({attrs.kind}. It must be a postgresql connection.)"
)
Expand Down
2 changes: 1 addition & 1 deletion awswrangler/s3/_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def __init__(
self._version_id = version_id
self._boto3_session: boto3.Session = _utils.ensure_session(session=boto3_session)
if mode not in {"rb", "wb", "r", "w"}:
raise NotImplementedError("File mode must be {'rb', 'wb', 'r', 'w'}, not %s" % mode)
raise NotImplementedError(f"File mode must be {'rb', 'wb', 'r', 'w'}, not {mode}")
self._mode: str = "rb" if mode is None else mode
self._one_shot_download: bool = False
if 0 < s3_block_size < 3:
Expand Down
2 changes: 1 addition & 1 deletion awswrangler/s3/_merge_upsert_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _is_data_quality_sufficient(
existing_df: pandas.DataFrame, delta_df: pandas.DataFrame, primary_key: List[str]
) -> bool:
"""Check data quality of existing table and the new delta feed."""
error_messages = list()
error_messages = []
existing_schema = _data_types.pyarrow_types_from_pandas(df=existing_df, index=False)
delta_schema = _data_types.pyarrow_types_from_pandas(df=delta_df, index=False)
# Check for duplicates on the primary key in the existing table
Expand Down
92 changes: 32 additions & 60 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ pandas = [
]
numpy = "^1.18.0"
pyarrow = ">=2.0.0, <5.1.0"
redshift-connector = "~2.0.884"
redshift-connector = "~2.0.888"
pymysql = ">=0.9.0, <1.1.0"
pg8000 = ">=1.16.0,<1.22.0"
openpyxl = "~3.0.0"
xlrd = { version = "^2.0.1", python = "~3.6" }
xlwt = { version = "^1.3.0", python = "~3.6" }

pyodbc = { version = "~4.0.30", optional = true }
pyodbc = { version = "~4.0.32", optional = true }
sphinx-bootstrap-theme = "^0.8.0"
Sphinx = "^4.2.0"
tox = "^3.24.4"
Expand All @@ -57,7 +57,7 @@ sqlserver = ["pyodbc"]
wheel = "^0.36.2"
isort = "^5.9.2"
black = "^21.7b0"
pylint = "^2.9.6"
pylint = "^2.11.1"
flake8 = "^3.9.2"
mypy = "^0.910"
pydocstyle = "^6.1.1"
Expand All @@ -66,7 +66,7 @@ tox = "^3.24.4"
pytest = "^6.2.4"
pytest-cov = "^2.12.1"
pytest-rerunfailures = "^10.1"
pytest-xdist = "^2.3.0"
pytest-xdist = "^2.4.0"
pytest-timeout = "^1.4.2"
pydot = "^1.4.2"
sphinx = "^4.2.0"
Expand Down