Re-enable pylint for some model files (#8770)

* Allow id as a valid name for pylint

* Re-enable pylint for superset/models/core.py

* re-enable pylint for superset/models/sql_lab.py

* re-enable pylint for superset/models/schedules.py

* re-enable pylint for superset/models/helpers.py

* re-enable pylint for superset/models/annotations.py

* re-enable pylint on superset/models/tags.py

* a couple more fixes after black formatting...

* Add another inline pylint disable

* Fix black

* Move to inline disables for 'id' attribute on models

* Fix lint disables after black reformatted them
This commit is contained in:
Will Barrett
2019-12-10 13:24:45 -08:00
committed by Maxime Beauchemin
parent 6c130b32ad
commit adf2cc2039
6 changed files with 167 additions and 133 deletions

View File

@@ -14,11 +14,11 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# pylint: disable=C,R,W
"""A collection of ORM sqlalchemy models for SQL Lab"""
import re
from datetime import datetime
# pylint: disable=ungrouped-imports
import simplejson as json
import sqlalchemy as sqla
from flask import Markup
@@ -48,7 +48,7 @@ class Query(Model, ExtraJSONMixin):
table may represent multiple SQL statements executed sequentially"""
__tablename__ = "query"
id = Column(Integer, primary_key=True)
id = Column(Integer, primary_key=True) # pylint: disable=invalid-name
client_id = Column(String(11), unique=True, nullable=False)
database_id = Column(Integer, ForeignKey("dbs.id"), nullable=False)
@@ -149,7 +149,7 @@ class SavedQuery(Model, AuditMixinNullable, ExtraJSONMixin):
"""ORM model for SQL query"""
__tablename__ = "saved_query"
id = Column(Integer, primary_key=True)
id = Column(Integer, primary_key=True) # pylint: disable=invalid-name
user_id = Column(Integer, ForeignKey("ab_user.id"), nullable=True)
db_id = Column(Integer, ForeignKey("dbs.id"), nullable=True)
schema = Column(String(128))
@@ -194,7 +194,9 @@ class TabState(Model, AuditMixinNullable, ExtraJSONMixin):
__tablename__ = "tab_state"
# basic info
id = Column(Integer, primary_key=True, autoincrement=True)
id = Column( # pylint: disable=invalid-name
Integer, primary_key=True, autoincrement=True
)
user_id = Column(Integer, ForeignKey("ab_user.id"))
label = Column(String(256))
active = Column(Boolean, default=False)
@@ -245,7 +247,9 @@ class TableSchema(Model, AuditMixinNullable, ExtraJSONMixin):
__tablename__ = "table_schema"
id = Column(Integer, primary_key=True, autoincrement=True)
id = Column( # pylint: disable=invalid-name
Integer, primary_key=True, autoincrement=True
)
tab_state_id = Column(Integer, ForeignKey("tab_state.id", ondelete="CASCADE"))
database_id = Column(Integer, ForeignKey("dbs.id"), nullable=False)