本文整理匯總了Python中sevenbridges.meta.transformer.Transform.to_dataset方法的典型用法代碼示例。如果您正苦於以下問題:Python Transform.to_dataset方法的具體用法?Python Transform.to_dataset怎麽用?Python Transform.to_dataset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sevenbridges.meta.transformer.Transform
的用法示例。
在下文中一共展示了Transform.to_dataset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: query
# 需要導入模塊: from sevenbridges.meta.transformer import Transform [as 別名]
# 或者: from sevenbridges.meta.transformer.Transform import to_dataset [as 別名]
def query(cls, project=None, names=None, metadata=None, origin=None,
tags=None, offset=None, limit=None, dataset=None, api=None,
parent=None):
"""
Query ( List ) files, requires project or dataset
:param project: Project id
:param names: Name list
:param metadata: Metadata query dict
:param origin: Origin query dict
:param tags: List of tags to filter on
:param offset: Pagination offset
:param limit: Pagination limit
:param dataset: Dataset id
:param api: Api instance.
:param parent: Folder id or File object with type folder
:return: Collection object.
"""
api = api or cls._API
query_params = {}
if project:
project = Transform.to_project(project)
query_params['project'] = project
if dataset:
dataset = Transform.to_dataset(dataset)
query_params['dataset'] = dataset
if parent:
query_params['parent'] = Transform.to_file(parent)
if not (project or dataset or parent):
raise SbgError('Project, dataset or parent must be provided.')
if [project, parent, dataset].count(None) < 2:
raise SbgError(
'Only one out of project, parent or dataset must be provided.'
)
if names is not None and isinstance(names, list):
if len(names) == 0:
names.append("")
query_params['name'] = names
metadata_params = {}
if metadata and isinstance(metadata, dict):
for k, v in metadata.items():
metadata_params['metadata.' + k] = metadata[k]
if tags:
query_params['tag'] = tags
query_params.update(metadata_params)
origin_params = {}
if origin and isinstance(origin, dict):
for k, v in origin.items():
origin_params['origin.' + k] = origin[k]
query_params.update(origin_params)
return super(File, cls)._query(
api=api, url=cls._URL['query'], offset=offset,
limit=limit, fields='_all', **query_params
)