Re-enable pylint for example-related files (#8771)
* re-enable pylint for superset/examples/energy.py * re-enable pylint for superset/examples/world_bank.py * re-enable pylint for superset/examples/tabbed_dashboard.py * Re-enable pylint for superset/examples/helpers.py
This commit is contained in:
parent
68aca88c54
commit
60892ae45d
|
|
@ -15,7 +15,6 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Loads datasets, dashboards and slices in a new superset instance"""
|
||||
# pylint: disable=C,R,W
|
||||
import textwrap
|
||||
|
||||
import pandas as pd
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Loads datasets, dashboards and slices in a new superset instance"""
|
||||
# pylint: disable=C,R,W
|
||||
import json
|
||||
import os
|
||||
import zlib
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Loads datasets, dashboards and slices in a new superset instance"""
|
||||
# pylint: disable=C,R,W
|
||||
import json
|
||||
import textwrap
|
||||
|
||||
|
|
@ -24,7 +23,7 @@ from superset import db
|
|||
from .helpers import Dash, Slice, update_slice_ids
|
||||
|
||||
|
||||
def load_tabbed_dashboard(only_metadata=False):
|
||||
def load_tabbed_dashboard(_=False):
|
||||
"""Creating a tabbed dashboard"""
|
||||
|
||||
print("Creating a dashboard with nested tabs")
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Loads datasets, dashboards and slices in a new superset instance"""
|
||||
# pylint: disable=C,R,W
|
||||
import json
|
||||
import os
|
||||
import textwrap
|
||||
|
|
@ -42,7 +41,9 @@ from .helpers import (
|
|||
)
|
||||
|
||||
|
||||
def load_world_bank_health_n_pop(only_metadata=False, force=False):
|
||||
def load_world_bank_health_n_pop(
|
||||
only_metadata=False, force=False
|
||||
): # pylint: disable=too-many-locals
|
||||
"""Loads the world bank health dataset, slices and a dashboard"""
|
||||
tbl_name = "wb_health_population"
|
||||
database = utils.get_example_database()
|
||||
|
|
@ -84,12 +85,12 @@ def load_world_bank_health_n_pop(only_metadata=False, force=False):
|
|||
"sum__SP_DYN_LE00_IN",
|
||||
"sum__SP_RUR_TOTL",
|
||||
]
|
||||
for m in metrics:
|
||||
if not any(col.metric_name == m for col in tbl.metrics):
|
||||
aggr_func = m[:3]
|
||||
col = str(column(m[5:]).compile(db.engine))
|
||||
for metric in metrics:
|
||||
if not any(col.metric_name == metric for col in tbl.metrics):
|
||||
aggr_func = metric[:3]
|
||||
col = str(column(metric[5:]).compile(db.engine))
|
||||
tbl.metrics.append(
|
||||
SqlMetric(metric_name=m, expression=f"{aggr_func}({col})")
|
||||
SqlMetric(metric_name=metric, expression=f"{aggr_func}({col})")
|
||||
)
|
||||
|
||||
db.session.merge(tbl)
|
||||
|
|
|
|||
Loading…
Reference in New Issue