【发布时间】:2021-09-15 12:27:30
【问题描述】:
我想列出 azure 容器中唯一的上周数据。我使用的python代码首先列出了整个数据,然后根据给定的if条件过滤它。
list1 = [a.name for a in container_client.list_blobs(name_starts_with='folder1/') if a.last_modified.date() in last_week]
这个命令所花费的时间随着folder1大小的增加而增加,那么他们有什么方法可以更有效地获取这个列表吗?
【问题讨论】:
-
你见过这个问题吗? stackoverflow.com/questions/44777851/…
-
我需要pythonic解决方案,他们给出的解决方案是命令行。
-
我指的是答案说这不能由 SDK(.NET 或 Python)或 Rest API 完成,但目前只能由 PowerShell 完成。答案还提供了在文件名前加上日期前缀的替代方法,以便您可以使用“name_starts_with”参数查询它们。
标签: python azure azure-python-sdk