本文整理汇总了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!')
示例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')
示例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)
示例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')