def METHOD_NAME(t, op):
    (arg,) = op.args
    sa_arg = t.translate(arg)
    # sa.literal_column is used because it makes the argument pass
    # in NOT as a parameter
    return sa.cast(sa.func.datepart(sa.literal_column(fmt), sa_arg), sa.SMALLINT)