Unable to read max_ttl of a collection by using Python SDK

Unable to read max_ttl of a collection by using Python SDK.
When I try to read collection information by using below sdk api call, it always returns 0, even collection has some value. Could you please check and correct me if I am going wrong way?

scopeSpecList = client.bucket(bucketName).collections().get_all_scopes()

for scopeSpec in scopeSpecList:
CollectionSpecList = scopeSpec.collections
collectionsInfo = β€œβ€
for collectionSpec in CollectionSpecList:
print(collectionsInfo)
if collectionsInfo:
collectionsInfo += β€œ,”
collectionsInfo += collectionSpec.name + β€œ:”
if collectionSpec.max_ttl:
collectionsInfo += str(collectionSpec.max_ttl)
else:
collectionsInfo += β€œ0”

Hi @SrinivasB - it might be better for you to submit a ticket on the github repo for the Python SDK: GitHub - couchbase/couchbase-python-client: Couchbase Python Client Library (Official) or jump into our Discord channel: Couchbase to troubleshoot this live. If you haven’t already read them, here are the API docs for the Python SDK regarding collections: Management β€” Couchbase Python Client Library 4.1.5 documentation

Hi @SrinivasB – I have created PYCBC-1500 to address this issue. It should be a quick fix so I am hopeful we can squeeze it into the next release. However, I cannot quite commit to that yet due to some other priorities I am juggling. We make sure we get the fix in as soon as we can though :+1: .

Just following up to mention we solved PYCBC-1500 and the change is included in the 4.1.6 version (released last week) of the Python SDK.

1 Like

Thank you very much @jcasey for you the update :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.