code: def upgrade_slice(slc):
      params = json.loads(slc.params)
      logging.info(f"Upgrading {slc.slice_name}")
      cols = params.get("groupby")
      metric = params.get("metric")
      if cols:
          flts = [
              {
                  "column": col,
                  "metric": metric,
                  "asc": False,
                  "clearable": True,
                  "multiple": True,
              }
              for col in cols
          ]
          params["filter_configs"] = flts
          if "groupby" in params:
              del params["groupby"]
          if "metric" in params:
              del params["metric"]
          slc.params = json.dumps(params, sort_keys=True)
  
file_path: superset/superset/migrations/versions/2018-12-11_22-03_fb13d49b72f9_better_filters.py
imports: import json
  import logging
  from alembic import op
  from sqlalchemy import Column, Integer, String, Text
  from sqlalchemy.ext.declarative import declarative_base
  from superset import db
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade_slice(slc) without return types