From 2f821f9c2d27834142e1f89bbedbee9874c355c2 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Wed, 29 Apr 2020 21:58:00 +0530 Subject: [PATCH] chore: fix deepsource issues * use set comprehension instead of generator * remove redundant else statement Signed-off-by: Chinmay D. Pai --- frappe/database/database.py | 2 +- frappe/database/schema.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frappe/database/database.py b/frappe/database/database.py index 3092e6c0ae..364f0c73cd 100644 --- a/frappe/database/database.py +++ b/frappe/database/database.py @@ -776,7 +776,7 @@ class Database(object): FROM information_schema.tables WHERE table_schema NOT IN ('pg_catalog', 'information_schema') """) - tables = set(d[0] for d in table_rows) + tables = {d[0] for d in table_rows} frappe.cache().set_value('db_tables', tables) return tables diff --git a/frappe/database/schema.py b/frappe/database/schema.py index 9c7008a8ed..83c22090eb 100644 --- a/frappe/database/schema.py +++ b/frappe/database/schema.py @@ -138,8 +138,7 @@ class DBTable: if frappe.db.is_missing_column(e): # Unknown column 'column_name' in 'field list' continue - else: - raise + raise if max_length and max_length[0][0] and max_length[0][0] > new_length: if col.fieldname in self.columns: