當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。