From add153fc4e8ded339902a3f23943c1209f51f736 Mon Sep 17 00:00:00 2001 From: alexferrari88 <49028826+alexferrari88@users.noreply.github.com> Date: Thu, 5 May 2022 11:45:50 +0200 Subject: [PATCH] Fix some linting errors (#1763) Co-authored-by: Alex Ferrari --- .../cryptocurrency/onchain/ethplorer_view.py | 10 +++++++--- openbb_terminal/keys_controller.py | 10 +++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py b/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py index 62073435061..1eef8498562 100644 --- a/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py +++ b/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py @@ -230,7 +230,9 @@ def display_token_info( df = ethplorer_model.get_token_info(address) df_data = df.copy() - df["Value"] = df["Value"].apply(lambda x: lambda_very_long_number_formatter(x)) + df.loc[:, "Value"] = df["Value"].apply( + lambda x: lambda_very_long_number_formatter(x) + ) socials = ["website", "telegram", "reddit", "twitter", "coingecko"] if social: @@ -319,7 +321,9 @@ def display_token_history( console.print(f"No results found for balance: {address}\n") return - df["value"] = df["value"].apply(lambda x: lambda_very_long_number_formatter(x)) + df.loc[:, "value"] = df["value"].apply( + lambda x: lambda_very_long_number_formatter(x) + ) df = df.sort_values(by=sortby, ascending=descend) if hash_: @@ -378,7 +382,7 @@ def display_token_historical_prices( df["volumeConverted"] = df["volumeConverted"].apply( lambda x: lambda_very_long_number_formatter(x) ) - df["cap"] = df["cap"].apply(lambda x: lambda_very_long_number_formatter(x)) + df.loc[:, "cap"] = df["cap"].apply(lambda x: lambda_very_long_number_formatter(x)) df = df.sort_values(by=sortby, ascending=descend) print_rich_table( diff --git a/openbb_terminal/keys_controller.py b/openbb_terminal/keys_controller.py index a00b45dd85c..3e43d4f9e94 100644 --- a/openbb_terminal/keys_controller.py +++ b/openbb_terminal/keys_controller.py @@ -538,7 +538,7 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods def check_walert_key(self, show_output: bool = False) -> None: """Check Walert key""" self.cfg_dict["WHALE_ALERT"] = "wa" - if "REPLACE_ME" == cfg.API_WHALE_ALERT_KEY: + if cfg.API_WHALE_ALERT_KEY == "REPLACE_ME": logger.info("Walert key not defined") self.key_dict["WHALE_ALERT"] = "not defined" else: @@ -564,7 +564,7 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods def check_glassnode_key(self, show_output: bool = False) -> None: """Check glassnode key""" self.cfg_dict["GLASSNODE"] = "glassnode" - if "REPLACE_ME" == cfg.API_GLASSNODE_KEY: + if cfg.API_GLASSNODE_KEY == "REPLACE_ME": logger.info("Glassnode key not defined") self.key_dict["GLASSNODE"] = "not defined" else: @@ -592,7 +592,7 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods def check_coinglass_key(self, show_output: bool = False) -> None: """Check coinglass key""" self.cfg_dict["COINGLASS"] = "coinglass" - if "REPLACE_ME" == cfg.API_COINGLASS_KEY: + if cfg.API_COINGLASS_KEY == "REPLACE_ME": logger.info("Coinglass key not defined") self.key_dict["COINGLASS"] = "not defined" else: @@ -615,7 +615,7 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods def check_cpanic_key(self, show_output: bool = False) -> None: """Check cpanic key""" self.cfg_dict["CRYPTO_PANIC"] = "cpanic" - if "REPLACE_ME" == cfg.API_CRYPTO_PANIC_KEY: + if cfg.API_CRYPTO_PANIC_KEY == "REPLACE_ME": logger.info("cpanic key not defined") self.key_dict["CRYPTO_PANIC"] = "not defined" else: @@ -638,7 +638,7 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods def check_ethplorer_key(self, show_output: bool = False) -> None: """Check ethplorer key""" self.cfg_dict["ETHPLORER"] = "ethplorer" - if "REPLACE_ME" == cfg.API_ETHPLORER_KEY: + if cfg.API_ETHPLORER_KEY == "REPLACE_ME": logger.info("ethplorer key not defined") self.key_dict["ETHPLORER"] = "not defined" else: