code: def downgrade():
      bind = op.get_bind()
      session = db.Session(bind=bind)
  
      for chart in session.query(Slice):
          params = json.loads(chart.params or "{}")
  
          if "time_compare" in params or "comparison_type" in params:
              params.pop("time_compare", None)
              params.pop("comparison_type", None)
              chart.params = json.dumps(params, sort_keys=True)
  
      session.commit()
      session.close()
  
file_path: superset/superset/migrations/versions/2018-07-05_15-19_3dda56f1c4c6_migrate_num_period_compare_and_period_.py
imports: import datetime
  import json
  import isodate
  from alembic import op
  from sqlalchemy import Column, Integer, String, Text
  from sqlalchemy.ext.declarative import declarative_base
  from superset import db
  from superset.utils.date_parser import parse_human_timedelta
label_desc: Use image node_id 6 for calling a global function with example usage: downgrade() without return types