File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -842,6 +842,14 @@ def add_virtual_input(self, input_dataset_index):
842842 """
843843 self .raw_virtual_inputs .append ({"index" : input_dataset_index })
844844
845+ def add_computed_column (self , virtual_input_index , computed_column ):
846+ """
847+ Adds a computed column to a virtual input
848+
849+ Use :class:`dataikuapi.dss.utils.DSSComputedColumn` to build the computed_column object
850+ """
851+ self .raw_virtual_inputs [virtual_input_index ]["computedColumns" ].append (computed_column )
852+
845853 def add_join (self , join_type = "LEFT" , input1 = 0 , input2 = 1 ):
846854 """
847855 Adds a join between two virtual inputs. The join is initialized with no condition.
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ def with_selected_partitions(self, ids):
4141 self .selection ["selectedPartitions" ] = ids
4242 return self
4343
44+ class DSSComputedColumn (object ):
45+
46+ @staticmethod
47+ def formula (name , formula , type = "double" ):
48+ return {"expr" : formula , "mode" : "GREL" , "name" : name , "type" : type }
4449
4550class DSSFilterBuilder (object ):
4651 """
You can’t perform that action at this time.
0 commit comments