我正在使用 python 对 Azure 表进行查询。
query = table_service.query_entities(table_name, filter=filter_string)
如何查看此查询返回的实体数量?我尝试过使用
query.count
query.count()
但没有运气。我收到以下错误。
'ListGenerator' object has no attribute 'count
在线搜索不断返回有关获取表中不相关的整行数的结果。
最佳答案
您应该使用len(query.items)
来获取返回的实体的数量。
代码如下:
query = table_service.query_entities(table_name, filter=filter_string)
print(len(query.items))
测试结果如下:
关于python - 如何获取 Azure 表查询中返回的实体数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66111206/