code: def downgrade():
      bind = op.get_bind()
      session = db.Session(bind=bind)
  
      for slc in session.query(Slice).filter(
          or_(Slice.viz_type.like("line"), Slice.viz_type.like("bar"))
      ):
          params = json.loads(slc.params)
          layers = params.get("annotation_layers", [])
          if layers:
              params["annotation_layers"] = [
                  layer["value"] for layer in layers
              ]
              slc.params = json.dumps(params)
              session.commit()
      session.close()
  
file_path: superset/superset/migrations/versions/2017-12-17_11-06_21e88bc06c02_annotation_migration.py
imports: import json
  from alembic import op
  from sqlalchemy import Column, Integer, or_, String, Text
  from sqlalchemy.ext.declarative import declarative_base
  from superset import db
label_desc: Use image node_id 2 for calling a global function with example usage: downgrade() without return types