Skip to content

STYLE: fix pylint consider-using-get warnings #49334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 6 additions & 13 deletions pandas/io/excel/_openpyxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ def _convert_to_style_kwargs(cls, style_dict: dict) -> dict[str, Serialisable]:

style_kwargs: dict[str, Serialisable] = {}
for k, v in style_dict.items():
if k in _style_key_map:
k = _style_key_map[k]
k = _style_key_map.get(k, k)
_conv_to_x = getattr(cls, f"_convert_to_{k}", lambda x: None)
new_v = _conv_to_x(v)
if new_v:
Expand Down Expand Up @@ -218,8 +217,7 @@ def _convert_to_font(cls, font_dict):

font_kwargs = {}
for k, v in font_dict.items():
if k in _font_key_map:
k = _font_key_map[k]
k = _font_key_map.get(k, k)
if k == "color":
v = cls._convert_to_color(v)
font_kwargs[k] = v
Expand Down Expand Up @@ -288,11 +286,8 @@ def _convert_to_fill(cls, fill_dict: dict[str, Any]):
pfill_kwargs = {}
gfill_kwargs = {}
for k, v in fill_dict.items():
pk = gk = None
if k in _pattern_fill_key_map:
pk = _pattern_fill_key_map[k]
if k in _gradient_fill_key_map:
gk = _gradient_fill_key_map[k]
pk = _pattern_fill_key_map.get(k)
gk = _gradient_fill_key_map.get(k)
if pk in ["start_color", "end_color"]:
v = cls._convert_to_color(v)
if gk == "stop":
Expand Down Expand Up @@ -336,8 +331,7 @@ def _convert_to_side(cls, side_spec):

side_kwargs = {}
for k, v in side_spec.items():
if k in _side_key_map:
k = _side_key_map[k]
k = _side_key_map.get(k, k)
if k == "color":
v = cls._convert_to_color(v)
side_kwargs[k] = v
Expand Down Expand Up @@ -375,8 +369,7 @@ def _convert_to_border(cls, border_dict):

border_kwargs = {}
for k, v in border_dict.items():
if k in _border_key_map:
k = _border_key_map[k]
k = _border_key_map.get(k, k)
if k == "color":
v = cls._convert_to_color(v)
if k in ["left", "right", "top", "bottom", "diagonal"]:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ disable = [
"comparison-with-itself",
"consider-merging-isinstance",
"consider-using-from-import",
"consider-using-get",
"consider-using-min-builtin",
"consider-using-sys-exit",
"consider-using-ternary",
Expand Down