code: def downgrade():
      """
      Convert all country names to sentence case
      """
      bind = op.get_bind()
      session = db.Session(bind=bind)
  
      for slc in (
          session.query(Slice)
          .filter(Slice.viz_type == "country_map")
          .all()
      ):
          try:
              params = json.loads(slc.params)
              if params.get("select_country"):
                  country = params["select_country"].lower()
                  params["select_country"] = (
                      country[0].upper() + country[1:]
                  )
                  slc.params = json.dumps(params, sort_keys=True)
          except Exception:
              pass
  
      session.commit()
      session.close()
  
file_path: superset/superset/migrations/versions/2021-04-09_16-14_085f06488938_country_map_use_lowercase_country_name.py
imports: import json
  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 2 for calling a global function with example usage: downgrade() without return types