In [1]: mytable(key='123', coll=None)
Out[1]: mytable(key='123', coll=[])
In [2]: mytable(key='123')
Out[2]: mytable(key='123', coll=[])
I've also tried without the default argument, or setting it to types.NoneType (fails with stdlib error cannot create 'NoneType' instances).
For a query it's the same. I've logged mytable.__init__ and it gets the coll=None kwarg same way.
The contents of the table are:
cqlsh:myspace> select * from mytable;
key | coll
--------------------------------------+------
2381fcdb-5634-4fd8-a94f-b632d0b57dac | null
I wonder if this is the intended behavior? Shouldn't a non-existent value and an empty collection be treated different?
I've checked this in driver version 3.7.1 and 2.7.2
For my application, I could live with an empty list but there are currently API tests that assert certain keys as None that I would need to change. This means also potentially affecting application logic too albeit unlikely.
Thanks,
Michael
--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-user+unsub...@lists.datastax.com.