def as_sql(self, qn, connection):
        lhs, params = qn.compile(self.lhs)

        if isinstance(self.key, int):
            return "(%s->>%s)" % (lhs, self.key), params

        return "(%s->>'%s')" % (lhs, self.key), params
dataset/ETHPy150Open djangonauts/django-pgjson/django_pgjson/lookups.py/KeyTransform.as_sql/original