@@ -32,7 +32,7 @@ class DSSAnalysisDefinition():
3232 """
3333
3434 def __init__ (self , analysis , acp ):
35- self .analysis = analysis
35+ self .analysis = analysis
3636 self .acp = acp
3737
3838 def get_raw (self ):
@@ -47,7 +47,7 @@ def get_raw_script(self):
4747 """
4848 acp = self .get_raw ()
4949 if not 'script' in acp :
50- acp ['script' ] = {'steps' :[]}
50+ acp ['script' ] = {'steps' :[]}
5151 return acp ['script' ]
5252
5353 def get_raw_script_steps (self ):
@@ -56,7 +56,7 @@ def get_raw_script_steps(self):
5656 """
5757 script = self .get_raw_script ()
5858 if not 'steps' in script :
59- script ['steps' ] = []
59+ script ['steps' ] = []
6060 return script ['steps' ]
6161
6262 def get_raw_script_sampling (self ):
@@ -65,26 +65,26 @@ def get_raw_script_sampling(self):
6565 """
6666 script = self .get_raw_script ()
6767 if not 'explorationSampling' in script :
68- script ['explorationSampling' ] = {}
68+ script ['explorationSampling' ] = {}
6969 return script ['explorationSampling' ]
7070
7171 def save (self ):
72- """
73- Shortcut to :meth:`DSSAnalysis.set_definition()`
74- """
75- self .analysis .set_definition (self )
72+ """
73+ Shortcut to :meth:`DSSAnalysis.set_definition()`
74+ """
75+ self .analysis .set_definition (self )
7676
7777 def add_step (self , step ):
78- """
79- Add a step to the script
78+ """
79+ Add a step to the script
8080
8181 :param object selection: A :class:`DSSAnalysisStepBuilder` to build the settings of the step.
82- """
82+ """
8383 steps = self .get_raw_script_steps ()
8484 if isinstance (step , DSSAnalysisStepBuilder ):
85- steps .append (step .build ())
85+ steps .append (step .build ())
8686 else :
87- steps .append (step )
87+ steps .append (step )
8888
8989 def set_script_sampling_selection (self , selection ):
9090 """
@@ -142,9 +142,9 @@ def set_definition(self, definition):
142142 You should only set a definition object that has been retrieved using the get_definition call.
143143 """
144144 if isinstance (definition , DSSAnalysisDefinition ):
145- acp = definition .get_raw ()
145+ acp = definition .get_raw ()
146146 else :
147- acp = definition
147+ acp = definition
148148 return self .client ._perform_json ("PUT" , "/projects/%s/lab/%s/" % (self .project_key , self .analysis_id ), body = acp )
149149
150150
@@ -236,7 +236,7 @@ def get_ml_task(self, mltask_id):
236236# some basic steps
237237class DSSFormulaStepBuilder (DSSAnalysisStepBuilder ):
238238 def __init__ (self , step_name = None ):
239- super (DSSFormulaStepBuilder , self ).__init__ (step_type = 'CreateColumnWithGREL' , step_name = step_name )
239+ super (DSSFormulaStepBuilder , self ).__init__ (step_type = 'CreateColumnWithGREL' , step_name = step_name )
240240
241241 def with_output_column (self , column_name ):
242242 """Sets the step's output column's name"""
@@ -255,8 +255,8 @@ def with_expression(self, expression):
255255
256256class AppliesToStepBuilder (DSSAnalysisStepBuilder ):
257257 def __init__ (self , step_type = None , step_name = None ):
258- super (AppliesToStepBuilder , self ).__init__ (step_type = step_type , step_name = step_name )
259- self .step ["params" ]["appliesTo" ] = 'SINGLE_COLUMN'
258+ super (AppliesToStepBuilder , self ).__init__ (step_type = step_type , step_name = step_name )
259+ self .step ["params" ]["appliesTo" ] = 'SINGLE_COLUMN'
260260
261261 def with_column_selection_mode (self , column_selection_mode ):
262262 """Sets the step's column selection mode (SINGLE_COLUMN, COLUMNS, PATTERN, ALL)"""
@@ -291,13 +291,13 @@ def with_all_column_selection(self, column_name):
291291
292292class FilterAndFlagStepBuilder (AppliesToStepBuilder ):
293293 def __init__ (self , step_type = None , step_name = None ):
294- super (FilterAndFlagStepBuilder , self ).__init__ (step_type = step_type , step_name = step_name )
295- self .step ["params" ]["booleanMode" ] = 'AND'
296- self .step ["params" ]["action" ] = 'REMOVE_ROW'
294+ super (FilterAndFlagStepBuilder , self ).__init__ (step_type = step_type , step_name = step_name )
295+ self .step ["params" ]["booleanMode" ] = 'AND'
296+ self .step ["params" ]["action" ] = 'REMOVE_ROW'
297297
298298 def with_action (self , action ):
299299 """Sets the step's action on match (KEEP_ROW, REMOVE_ROW, CLEAR_CELL, DONTCLEAR_CELL, FLAG)"""
300- self .step ["params" ]["action" ] = column_selection_mode
300+ self .step ["params" ]["action" ] = action
301301 return self
302302
303303 def with_boolean_mode (self , boolean_mode ):
@@ -312,7 +312,7 @@ def with_flag_column(self, column_name):
312312
313313class FilterOnValueStepBuilder (FilterAndFlagStepBuilder ):
314314 def __init__ (self , step_name = None ):
315- super (FilterOnValueStepBuilder , self ).__init__ (step_type = 'FlagOnValue' , step_name = step_name )
315+ super (FilterOnValueStepBuilder , self ).__init__ (step_type = 'FlagOnValue' , step_name = step_name )
316316
317317 def with_values (self , * values ):
318318 """Sets the step's flagged values"""
@@ -331,7 +331,7 @@ def with_normalization_mode(self, normalization_mode):
331331
332332class FilterOnBadTypeStepBuilder (FilterAndFlagStepBuilder ):
333333 def __init__ (self , step_name = None ):
334- super (FilterOnBadTypeStepBuilder , self ).__init__ (step_type = 'FilterOnBadType' , step_name = step_name )
334+ super (FilterOnBadTypeStepBuilder , self ).__init__ (step_type = 'FilterOnBadType' , step_name = step_name )
335335
336336 def with_meaning (self , meaning ):
337337 """Sets the step's meaning to check"""
@@ -340,7 +340,7 @@ def with_meaning(self, meaning):
340340
341341class RemoveRowsStepBuilder (AppliesToStepBuilder ):
342342 def __init__ (self , step_name = None ):
343- super (RemoveRowsStepBuilder , self ).__init__ (step_type = 'RemoveRowsOnEmpty' , step_name = step_name )
343+ super (RemoveRowsStepBuilder , self ).__init__ (step_type = 'RemoveRowsOnEmpty' , step_name = step_name )
344344
345345 def with_meaning (self , keep ):
346346 """Sets the step's behavior when an empty value is found : True=keep, False=drop (default)"""
0 commit comments