code: def should_copy(column):
      
      if not isinstance(column.type, Serial):
          return True
  
      if column.nullable:
          return True
  
      if not column.server_default:
          return True
  
      # do not create temporary serial values; they will be defaulted on upsert/insert
      return False
docs: Determine if a column should be copied.