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


Python Dart.delete_dataset方法代码示例

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


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

示例1: TestDatasetCrud

# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import delete_dataset [as 别名]
class TestDatasetCrud(unittest.TestCase):
    def setUp(self):
        self.dart = Dart(host='localhost', port=5000)

    def test_crud(self):
        columns = [Column('c1', DataType.VARCHAR, 50), Column('c2', DataType.BIGINT)]
        df = DataFormat(FileFormat.PARQUET, RowFormat.NONE)
        ds = Dataset(
            data=DatasetData(name=NoOpActionTypes.action_that_succeeds.name,
                             table_name=NoOpActionTypes.action_that_succeeds.name,
                             load_type=LoadType.INSERT,
                             location='s3://bucket/prefix',
                             data_format=df,
                             columns=columns,
                             tags=['foo']))
        ds.data.user_id = '[email protected]'
        posted_dataset = self.dart.save_dataset(ds)
        self.assertEqual(posted_dataset.data.to_dict(), ds.data.to_dict())

        dataset = self.dart.get_dataset(posted_dataset.id)
        self.assertEqual(posted_dataset.to_dict(), dataset.to_dict())

        dataset.data.compression = Compression.GZIP
        put_dataset = self.dart.save_dataset(dataset)
        self.assertEqual(put_dataset.data.compression, Compression.GZIP)
        self.assertNotEqual(posted_dataset.to_dict(), put_dataset.to_dict())

        self.dart.delete_dataset(dataset.id)
        try:
            self.dart.get_dataset(dataset.id)
        except DartRequestException as e:
            self.assertEqual(e.response.status_code, 404)
            return

        self.fail('dataset should have been missing after delete!')
开发者ID:RetailMeNotSandbox,项目名称:dart,代码行数:37,代码来源:test_dataset.py

示例2: Dart

# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import delete_dataset [as 别名]
from dart.client.python.dart_client import Dart

if __name__ == '__main__':
    dart = Dart('localhost', 5000)
    assert isinstance(dart, Dart)

    dart.delete_dataset('4S5DC2VGED')
    dart.delete_datastore('N4ILZV77D0')
    dart.delete_action('WS8PXAVIK2')
    dart.delete_action('SZWQV8MUXB')
开发者ID:RetailMeNotSandbox,项目名称:dart,代码行数:12,代码来源:delete_all.py

示例3: Dart

# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import delete_dataset [as 别名]
from dart.client.python.dart_client import Dart

if __name__ == '__main__':
    dart = Dart('localhost', 5000)
    assert isinstance(dart, Dart)

    trigger = ''
    dataset_id = ''
    datastore_id = ''

    trigger = dart.get_trigger(trigger)
    for workflow_id in trigger.data.workflow_ids:
        for wfi in dart.get_workflow_instances(workflow_id):
            datastore_id = wfi.data.datastore_id
            for a in dart.get_actions(datastore_id=datastore_id):
                dart.delete_action(a.id)

        dart.delete_workflow_instances(workflow_id)
        dart.delete_workflow(workflow_id)

    if datastore_id:
        dart.delete_datastore(datastore_id)

    if dataset_id:
        dart.delete_dataset(dataset_id)
开发者ID:RetailMeNotSandbox,项目名称:dart,代码行数:27,代码来源:delete_all_triggered.py

示例4: Dart

# 需要导入模块: from dart.client.python.dart_client import Dart [as 别名]
# 或者: from dart.client.python.dart_client.Dart import delete_dataset [as 别名]
from dart.client.python.dart_client import Dart

if __name__ == '__main__':
    dart = Dart('localhost', 5000)
    assert isinstance(dart, Dart)

    trigger = dart.delete_dataset('Z4QGSQ2GUT')
开发者ID:RetailMeNotSandbox,项目名称:dart,代码行数:9,代码来源:delete_dataset.py


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