Skip to content

Commit

Permalink
Remove unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed May 17, 2022
1 parent 107cffc commit de06b36
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions sqlalchemy_exasol/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,13 @@ def on_connect(self):
# TODO: set isolation level
pass

def _get_schema_names_query(self, connection, **kw):
def _get_schema_names_query(self, connection):
return "select SCHEMA_NAME from SYS.EXA_SCHEMAS"

# never called during reflection
@reflection.cache
def get_schema_names(self, connection, **kw):
sql_statement = self._get_schema_names_query(connection, **kw)
sql_statement = self._get_schema_names_query(connection)
result = connection.execute(sql.text(sql_statement))
return [self.normalize_name(row[0]) for row in result]

Expand Down Expand Up @@ -588,7 +588,7 @@ def get_column_sql_query_str():


@reflection.cache
def _get_columns(self, connection, table_name, schema=None, **kw):
def _get_columns(self, connection, table_name, schema=None):
schema = self._get_schema_for_input(connection, schema)
schema_str = "CURRENT_SCHEMA" if schema is None else ":schema"
table_name_str = ":table"
Expand All @@ -606,12 +606,7 @@ def get_columns(self, connection, table_name, schema=None, **kw):
return []

columns = []
rows = self._get_columns(
connection,
table_name=table_name,
schema=schema,
**kw
)
rows = self._get_columns(connection, table_name=table_name, schema=schema)
for row in rows:
(colname, coltype, length, precision, scale, nullable, default, identity, is_distribution_key) = \
(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8])
Expand Down Expand Up @@ -684,7 +679,7 @@ def _get_constraint_sql_str(schema, table_name, contraint_type):


@reflection.cache
def _get_pk_constraint(self, connection, table_name, schema, **kw):
def _get_pk_constraint(self, connection, table_name, schema):
schema = self._get_schema_for_input(connection, schema)
table_name = self.denormalize_name(table_name)
table_name_string = ":table"
Expand Down Expand Up @@ -712,11 +707,11 @@ def _get_pk_constraint(self, connection, table_name, schema, **kw):
def get_pk_constraint(self, connection, table_name, schema=None, **kw):
if table_name is None:
return None
return self._get_pk_constraint(connection, table_name, schema=schema, **kw)
return self._get_pk_constraint(connection, table_name, schema=schema)


@reflection.cache
def _get_foreign_keys(self, connection, table_name, schema=None, **kw):
def _get_foreign_keys(self, connection, table_name, schema=None):
table_name_string = ":table"
schema_string = "CURRENT_SCHEMA " if schema is None else ":schema "
sql_statement = self._get_constraint_sql_str(schema_string, table_name_string, "FOREIGN KEY")
Expand Down Expand Up @@ -744,7 +739,7 @@ def fkey_rec():
}

fkeys = util.defaultdict(fkey_rec)
constraints = self._get_foreign_keys(connection, table_name=table_name, schema=schema_int, **kw)
constraints = self._get_foreign_keys(connection, table_name=table_name, schema=schema_int)
for row in constraints:
(cons_name, local_column, remote_schema, remote_table, remote_column) = \
(row[0], row[1], row[2], row[3], row[4])
Expand Down

0 comments on commit de06b36

Please sign in to comment.