Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose role kwarg within SingleOutputRecipeCreator.with_output() and SingleOutputRecipeCreator.with_existing_output() #273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dataikuapi/dss/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def __init__(self, type, name, project):
self.create_output_folder = None
self.output_folder_settings = None

def with_existing_output(self, dataset_name, append=False):
def with_existing_output(self, dataset_name, append=False, role="main"):
"""
Add an existing object as output to the recipe-to-be-created

Expand All @@ -669,7 +669,7 @@ def with_existing_output(self, dataset_name, append=False):
"""
assert self.create_output_dataset is None
self.create_output_dataset = False
self._with_output(dataset_name, append)
self._with_output(dataset_name, append, role=role)
return self

def with_new_output(self, name, connection_id, typeOptionId=None, format_option_id=None, override_sql_schema=None, partitioning_option_id=None, append=False, object_type='DATASET', overwrite=False):
Expand Down Expand Up @@ -709,9 +709,9 @@ def with_new_output(self, name, connection_id, typeOptionId=None, format_option_
self._with_output(name, append)
return self

def with_output(self, dataset_name, append=False):
def with_output(self, dataset_name, append=False, role="main"):
"""Alias of with_existing_output"""
return self.with_existing_output(dataset_name, append)
return self.with_existing_output(dataset_name, append, role=role)

def _finish_creation_settings(self):
self.creation_settings['createOutputDataset'] = self.create_output_dataset
Expand Down