From ba190880a6cc4a9d0bd17d8074aab416d0ab32fd Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Fri, 8 Apr 2022 00:19:14 +0100 Subject: [PATCH] Improve code quality based on DeepSource (#299) DeepSource identified: Method '_table_exists_in_db' is abstract in class 'SqlDecoratedOperator' but is not overridden Method 'handle_dataframe_func' is abstract in class 'SqlDecoratedOperator' but is not overridden In several subclasses, as part of: https://deepsource.io/gh/astro-projects/astro/run/99bc601f-513a-4dbc-b771-65cf795aa2aa/python/PYL-W0223 --- src/astro/sql/operators/sql_decorator.py | 7 ------- src/astro/sql/parsers/sql_directory_parser.py | 6 ------ 2 files changed, 13 deletions(-) diff --git a/src/astro/sql/operators/sql_decorator.py b/src/astro/sql/operators/sql_decorator.py index 140520b88..509acd8e5 100644 --- a/src/astro/sql/operators/sql_decorator.py +++ b/src/astro/sql/operators/sql_decorator.py @@ -246,9 +246,6 @@ def clean_trailing_semicolon(query): statement = f"CREATE TABLE {output_table_name} AS ({clean_trailing_semicolon(query)});" return statement - def handle_dataframe_func(self, input_table): - raise NotImplementedError("Need to add dataframe func to class") - @provide_session def pre_execute(self, context, session=None): """This hook is triggered right before self.execute() is called.""" @@ -260,10 +257,6 @@ def post_execute(self, context, result=None): """ pass - def _table_exists_in_db(self, conn: str, table_name: str): - """Override this method to enable sensing db.""" - raise NotImplementedError("Add _table_exists_in_db method to class") - def _process_params(self): if self.conn_type == "snowflake": self.parameters = snowflake_transform.process_params( diff --git a/src/astro/sql/parsers/sql_directory_parser.py b/src/astro/sql/parsers/sql_directory_parser.py index ce0451075..8f345cb38 100644 --- a/src/astro/sql/parsers/sql_directory_parser.py +++ b/src/astro/sql/parsers/sql_directory_parser.py @@ -218,12 +218,6 @@ def find_templated_fields(file_string): class ParsedSqlOperator(SqlDecoratedOperator): template_fields = ("parameters",) - def _table_exists_in_db(self, conn: str, table_name: str): - pass - - def handle_dataframe_func(self, input_table): - pass - def __init__( self, sql,