mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Fix a bunch of files with pylint disabled (#8743)
* Re-enable pylint for superset/jinja_context.py * Re-enable pylint for superset/sql_lab.py * Re-enable pylint for superset/sql_parse.py * Re-enable pylint for superset/exceptions.py * Re-enable lint for superset/translations/utils.py * Re-enable pylint for superset/views/schedules.py * Re-enable pylint for superset/views/base.py * Re-enable pylint for superset/views/log/views.py * Re-enable pylint for superset/views/annotations.py * black * PR feedback, pylint, isort fixes * Black, one more time... * Move ungrouped-imports to a global disable
This commit is contained in:
committed by
Maxime Beauchemin
parent
60914fa76a
commit
562aeab1aa
@@ -14,7 +14,6 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# pylint: disable=C,R,W
|
||||
from flask_appbuilder.models.sqla.interface import SQLAInterface
|
||||
from flask_babel import gettext as __, lazy_gettext as _
|
||||
from wtforms.validators import StopValidation
|
||||
@@ -25,7 +24,7 @@ from superset.models.annotations import Annotation, AnnotationLayer
|
||||
from .base import DeleteMixin, SupersetModelView
|
||||
|
||||
|
||||
class StartEndDttmValidator(object):
|
||||
class StartEndDttmValidator(object): # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
Validates dttm fields.
|
||||
"""
|
||||
@@ -43,7 +42,9 @@ class StartEndDttmValidator(object):
|
||||
)
|
||||
|
||||
|
||||
class AnnotationModelView(SupersetModelView, DeleteMixin):
|
||||
class AnnotationModelView(
|
||||
SupersetModelView, DeleteMixin
|
||||
): # pylint: disable=too-many-ancestors
|
||||
datamodel = SQLAInterface(Annotation)
|
||||
|
||||
list_title = _("List Annotation")
|
||||
@@ -79,17 +80,19 @@ class AnnotationModelView(SupersetModelView, DeleteMixin):
|
||||
|
||||
validators_columns = {"start_dttm": [StartEndDttmValidator()]}
|
||||
|
||||
def pre_add(self, obj):
|
||||
if not obj.start_dttm:
|
||||
obj.start_dttm = obj.end_dttm
|
||||
elif not obj.end_dttm:
|
||||
obj.end_dttm = obj.start_dttm
|
||||
def pre_add(self, item):
|
||||
if not item.start_dttm:
|
||||
item.start_dttm = item.end_dttm
|
||||
elif not item.end_dttm:
|
||||
item.end_dttm = item.start_dttm
|
||||
|
||||
def pre_update(self, obj):
|
||||
self.pre_add(obj)
|
||||
def pre_update(self, item):
|
||||
self.pre_add(item)
|
||||
|
||||
|
||||
class AnnotationLayerModelView(SupersetModelView, DeleteMixin):
|
||||
class AnnotationLayerModelView(
|
||||
SupersetModelView, DeleteMixin
|
||||
): # pylint: disable=too-many-ancestors
|
||||
datamodel = SQLAInterface(AnnotationLayer)
|
||||
|
||||
list_title = _("List Annotation Layer")
|
||||
|
||||
Reference in New Issue
Block a user