code: def downgrade():
      bind = op.get_bind()
      session = db.Session(bind=bind)
  
      for slc in session.query(Slice).all():
          try:
              params = json.loads(slc.params)
  
              if "resample_method" in params:
                  method = params["resample_method"]
  
                  if method in ["asfreq", "bfill", "ffill"]:
                      params["resample_fillmethod"] = method
                  else:
                      params["resample_how"] = method
  
                  del params["resample_method"]
                  slc.params = json.dumps(params, sort_keys=True)
          except Exception as ex:
              logging.exception(ex)
  
      session.commit()
      session.close()
  
file_path: superset/superset/migrations/versions/2019-06-28_13-17_ab8c66efdd01_resample.py
imports: 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
label_desc: Use image node_id 2 for calling a global function with example usage: downgrade() without return types