Login
Back to bricks list
Introduction Version

TableColumnSelector

Select part of a table using column names. Multiple column names can be provided.

It also supports regexp.

Attributes

config_specs: Dictfile_downloader: FileDownloaderinput_name: strinput_specs: InputSpecsmessage_dispatcher: MessageDispatcheroutput_name: stroutput_specs: OutputSpecsstyle: TypingStyle

Functions

__INIT__

Constructor, please do not overwrite this method, use the init method instead Leave the constructor without parameters

CHECK_BEFORE_RUN

This can be overwritten to perform custom check before running task. See doc of CheckBeforeTaskResult for more information

Parameters:
NameTypeDefault valueDescription
paramsConfigParams
inputsTaskInputs
Return type:
CheckBeforeTaskResult
CONVERT

Override this method to implement convert method

Parameters:
NameTypeDefault valueDescription
sourceResource
paramsConfigParams [description]
target_typeType [description] [resource]
Return type:
Resource
GET_DEFAULT_OUTPUT_SPEC_TYPE
Parameters:
NameTypeDefault valueDescription
spec_namestr
Return type:
Type
INIT

This can be overwritten to perform custom initialization of the task. This method is called just after the init and before the check_before_run method

LOG_DEBUG_MESSAGE
Parameters:
NameTypeDefault valueDescription
messagestr
LOG_ERROR_MESSAGE
Parameters:
NameTypeDefault valueDescription
messagestr
LOG_INFO_MESSAGE
Parameters:
NameTypeDefault valueDescription
messagestr
LOG_MESSAGE

Store a message in the progress

Parameters:
NameTypeDefault valueDescription
messagestr Message to store in the progress
type_MessageLevel
LOG_SUCCESS_MESSAGE
Parameters:
NameTypeDefault valueDescription
messagestr
LOG_WARNING_MESSAGE
Parameters:
NameTypeDefault valueDescription
messagestr
RUN

This must be overiwritten to perform the task of the task.

This is where most of your code must go

Parameters:
NameTypeDefault valueDescription
paramsConfigParams [description] config
inputsTaskInputs [description] input
Return type:
Dict
RUN_AFTER_TASK

This can be overwritten to perform action after the task run. This method is called after the resources are saved. This method is useful to delete temporary objects (like files) to clear the server after the task is run.

TRANSFORM

Override this method to write the Transformer code

Parameters:
NameTypeDefault valueDescription
sourceTable Resource to modifify, the source object can be directly modify as this is already a new copy resource
paramsConfigParams Params for the transform
Return type:
Table
UPDATE_PROGRESS_VALUE

Update the progress value

Parameters:
NameTypeDefault valueDescription
valuefloat Value between 0 and 100 of the progress
messagestr If provided a message is stored on the progress
CALL - @classmethod

Call the ResourceExporter method manually

Parameters:
NameTypeDefault valueDescription
sourceResource
paramsDict Params for the import_from_path_method configparams
Return type:
Resource
CLASSNAME - @classmethod

Returns the name of the class

Parameters:
NameTypeDefault valueDescription
slugifybool False True to slugify the class name if true, defaults to false , optional
snakefybool False True to snakefy the class name if true, defaults to false , optional
replace_uppercasebool False Replace upper cases by "-" if true, defaults to false , optional
Return type:
str
DECORATED_METHOD_NAMES - @classmethod
Parameters:
NameTypeDefault valueDescription
decorator_nameAny
FULL_CLASSNAME - @classmethod

Returns the full name of the class

Parameters:
NameTypeDefault valueDescription
slugifybool False Slugify the returned class name if true, defaults to false , optional
snakefybool False Snakefy the returned class name if true, defaults to false ``
Return type:
str
GET_BRICK_NAME - @classmethod
Return type:
str
GET_COMPATIBLE_INPUT_NAME - @classmethod

Returns the name of the first compatible input for the given resource types Returns None if no compatible input is found

Parameters:
NameTypeDefault valueDescription
resource_typesList
Return type:
bool
GET_COMPATIBLE_OUTPUT_NAME - @classmethod

Returns the name of the first compatible output for the given resource types Returns None if no compatible output is found

Parameters:
NameTypeDefault valueDescription
resource_typesList
Return type:
bool
GET_INPUT_SPECS - @classmethod

Returns the input specs of the process

Return type:
InputSpecs
GET_OUTPUT_SPECS - @classmethod

Returns the input specs of the process

Return type:
OutputSpecs
GET_SOURCE_TYPE - @classmethod

Get the type of the input source

Return type:
Tuple
GET_TARGET_TYPE - @classmethod

Get the type of the output target

Return type:
Type
INHERITORS - @classmethod

Get all the classes that inherit this class

Return type:
List
METHOD_NAMES - @classmethod

Returns the list of the methods

Return type:
List
MODULE_NAME - @classmethod

Returns the module name of the class

Return type:
str
PROPERTY_METHOD_NAMES - @classmethod
PROPERTY_NAMES - @classmethod

Retrieves the property names

Parameters:
NameTypeDefault valueDescription
instancetype The s of the properties to retrieve. set `none` to retrieve all. `type` or `union[type]`
excludetype
Return type:
List