Skip to content

Commit

Permalink
Improve code quality based on DeepSource (#299)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tatiana authored Apr 7, 2022
1 parent f9a50f4 commit ba19088
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
7 changes: 0 additions & 7 deletions src/astro/sql/operators/sql_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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(
Expand Down
6 changes: 0 additions & 6 deletions src/astro/sql/parsers/sql_directory_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ba19088

Please sign in to comment.