TypeError: not all arguments converted during string formatting in CQL

TypeError: not all arguments converted during string formatting in CQL

我正在尝试使用以下代码将可变字符串插入 Cassandra table:

b64_enc = "R21haWw="
class SimpleClient:
    session = None

    def create_schema(self):
        self.session.execute("""CREATE KEYSPACE raas WITH replication = {'class':'SimpleStrategy', 'replication_factor':3};""")
        self.session.execute("""
            CREATE TABLE raas.result (
                userb64enc text PRIMARY KEY,
                statusflag int,
                statusstr text
            );
        """)
        log.info('Simplex keyspace and schema created.')

    def load_data(self):

        self.session.execute("""INSERT INTO raas.result (userb64enc, statusflag, statusstr) VALUES(%s,0,'Success');""",  (b64_enc))
        log.info('Data loaded.')

但是我得到了

TypeError: not all arguments converted during string formatting

留言。我也试过使用 ?代替 %s,但我得到同样的错误。知道这个错误的原因是什么吗?

我回答了我自己的问题 - %s 必须用引号引起来,因为它是文本类型。