map_column
table.map_column
                                                                                
 Documentation                                                                  
                          Map the items of one column of a table onto an        
                          array, using another module.                          
                                                                                
 Origin                                                                         
                          Authors   Markus Binsteiner (markus@frkl.io)          
                                                                                
 Context                                                                        
                          Tags         core                                     
                          Labels       package: kiara_modules.core              
                          References   source_repo:                             
                                       https://github.com/DHARPA-Project/kia…   
                                       documentation:                           
                                       https://dharpa.org/kiara_modules.core/   
                                       module_doc:                              
                                       https://dharpa.org/kiara_modules.core…   
                                       source_url:                              
                                       https://github.com/DHARPA-Project/kia…   
                                                                                
 Module config                                                                  
                          Field           Type     Description       Required   
                         ─────────────────────────────────────────────────────  
                          constants       object   Value constants   no         
                                                   for this                     
                                                   module.                      
                          defaults        object   Value defaults    no         
                                                   for this                     
                                                   module.                      
                          module_type     string   The name of the   yes        
                                                   kiara module to              
                                                   use to filter                
                                                   the input data.              
                          module_config   object   The config for    no         
                                                   the kiara                    
                                                   filter module.               
                          input_name      string   The name of the   no         
                                                   input name of                
                                                   the module                   
                                                   which will                   
                                                   receive the                  
                                                   rows from our                
                                                   input table.                 
                                                   Can be omitted               
                                                   if the                       
                                                   configured                   
                                                   module only has              
                                                   a single input.              
                          output_name     string   The name of the   no         
                                                   output name of               
                                                   the module                   
                                                   which will                   
                                                   receive the                  
                                                   items from our               
                                                   input array.                 
                                                   Can be omitted               
                                                   if the                       
                                                   configured                   
                                                   module only has              
                                                   a single                     
                                                   output.                      
                                                                                
 Module config          -- no config --                                         
 Python class                                                                   
                          class_name    MapColumnModule                         
                          module_name   kiara_modules.core.table                
                          full_name     kiara_modules.core.table.MapColumnMo…   
                                                                                
 Processing source code  ─────────────────────────────────────────────────────  
                          def process(self, inputs: ValueSet, outputs: Value…   
                                                                                
                              import pyarrow as pa                              
                                                                                
                              table: pa.Table = inputs.get_value_data("table…   
                              column_name = inputs.get_value_data("column_na…   
                                                                                
                              if column_name not in table.column_names:         
                                  raise KiaraProcessingException(               
                                      f"Table column '{column_name}' not ava…   
                                  )                                             
                                                                                
                              input_array: pa.Array = table.column(column_na…   
                                                                                
                              init_data: typing.Dict[str, typing.Any] = {}      
                              for input_name in self.input_schemas.keys():      
                                  if input_name in ["table", "column_name", …   
                                      continue                                  
                                                                                
                                  init_data[input_name] = inputs.get_value_o…   
                                                                                
                              result_list = map_with_module(                    
                                  input_array,                                  
                                  module_input_name=self.module_input_name,     
                                  module_obj=self.child_module,                 
                                  init_data=init_data,                          
                                  module_output_name=self.module_output_name,   
                              )                                                 
                              outputs.set_value("array", pa.array(result_lis…   
                                                                                
                         ─────────────────────────────────────────────────────