code: def upgrade():
      bind = op.get_bind()
      session = db.Session(bind=bind)
  
      for slc in session.query(Slice).filter(
          Slice.params.like("%time_range_endpoints%")
      ):
          params = json.loads(slc.params)
          params.pop("time_range_endpoints", None)
          slc.params = json.dumps(params)
  
      session.commit()
      session.close()
  
file_path: superset/superset/migrations/versions/2022-04-04_15-04_b0d0249074e4_deprecate_time_range_endpoints_v2.py
imports: import json
  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 1 for calling a global function with example usage: upgrade() without return types