code: def upgrade():
      bind = op.get_bind()
      session = db.Session(bind=bind)
  
      for slc in session.query(Slice).all():
          if slc.params:
              try:
                  source = json.loads(slc.params)
                  target = copy.deepcopy(source)
                  convert_legacy_filters_into_adhoc(target)
  
                  if source != target:
                      slc.params = json.dumps(target, sort_keys=True)
              except Exception as ex:
                  logging.warn(ex)
  
      session.commit()
      session.close()
  
file_path: superset/superset/migrations/versions/2019-11-06_15-23_78ee127d0d1d_reconvert_legacy_filters_into_adhoc.py
imports: import copy
  import json
  import logging
  from alembic import op
  from sqlalchemy import Column, Integer, Text
  from sqlalchemy.ext.declarative import declarative_base
  from superset import db
  from superset.utils.core import convert_legacy_filters_into_adhoc, split_adhoc_filters_into_base_filters
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types