当前位置: 首页>>代码示例>>Python>>正文


Python Dataset._scan方法代码示例

本文整理汇总了Python中moztelemetry.dataset.Dataset._scan方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset._scan方法的具体用法?Python Dataset._scan怎么用?Python Dataset._scan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在moztelemetry.dataset.Dataset的用法示例。


在下文中一共展示了Dataset._scan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_scan_with_prefix

# 需要导入模块: from moztelemetry.dataset import Dataset [as 别名]
# 或者: from moztelemetry.dataset.Dataset import _scan [as 别名]
def test_scan_with_prefix():
    bucket_name = 'test-bucket'
    store = InMemoryStore(bucket_name)
    store.store['prefix1/dir1/subdir1/key1'] = 'value1'
    store.store['prefix2/dir2/another-dir/key2'] = 'value2'
    dataset = Dataset(bucket_name, ['dim1', 'dim2'],
                      clauses={'dim1': lambda x: x == 'dir1'}, store=store)
    with futures.ProcessPoolExecutor(1) as executor:
        folders = dataset._scan(['dim1', 'dim2',], ['prefix1/',], dataset.clauses, executor)
    assert list(folders) == ['prefix1/dir1/']
开发者ID:whd,项目名称:python_moztelemetry,代码行数:12,代码来源:test_dataset.py

示例2: test_scan_no_clause

# 需要导入模块: from moztelemetry.dataset import Dataset [as 别名]
# 或者: from moztelemetry.dataset.Dataset import _scan [as 别名]
def test_scan_no_clause():
    bucket_name = 'test-bucket'
    store = InMemoryStore(bucket_name)
    key = 'dir1/dir2/key1'
    value = 'value1'
    store.store[key] = value

    dataset = Dataset(bucket_name, ['dim1', 'dim2'], store=store)
    with futures.ProcessPoolExecutor(1) as executor:
        folders = dataset._scan(['dim1', 'subdir'], ['prefix'], {}, executor)
    assert list(folders) == ['prefix']
开发者ID:mozilla,项目名称:python_moztelemetry,代码行数:13,代码来源:test_dataset.py

示例3: test_scan_no_dimensions

# 需要导入模块: from moztelemetry.dataset import Dataset [as 别名]
# 或者: from moztelemetry.dataset.Dataset import _scan [as 别名]
def test_scan_no_dimensions():
    dataset = Dataset('test-bucket', ['dim1', 'dim2'], prefix='prefix/')
    with futures.ProcessPoolExecutor(1) as executor:
        folders = dataset._scan([], ['prefix/', ], {}, executor)

    assert folders == ['prefix/', ]
开发者ID:mozilla,项目名称:python_moztelemetry,代码行数:8,代码来源:test_dataset.py


注:本文中的moztelemetry.dataset.Dataset._scan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。