Login
Back to bricks list
Introduction Version

TableAnnotatorHelper

TableRowAnnotatorHelper

Annotate the rows of a sample_table using information from a metadata_table.

  • all the row values of the reference column of the sample_table are matched against the ids of the metadata_table.
  • if an id matches against a reference value of the sample_table, the corresponding row of the sample_table is taggeg with the metadata given by the id.

Functions

ANNOTATE_COLUMNS - @classmethod

Annotate the columns of a table using information from a metadata_table. All the column values of the reference row of the table are matched against the ids of the metadata_table. If an id matches against a reference value of the table, the corresponding column of the table is tagged with the metadata given by the id.

                  If None or empty, the first row is used, defaults to None
                              If None or empty, the first column is used, defaults to None

:raises BadRequestException: description

Parameters:
NameTypeDefault valueDescription
tableTable The table to annotate :param table_ref_row: ref row of the table to match against the metadata table :type table_ref_row: str, optional
metadata_tableTable The metadata table metadata :param metadata_table_ref_column: ref column of the metadata table to match against the table :type metadata_table_ref_column: str, optional
table_ref_rowstr Ref row of the table to match against the metadata table , optional
metadata_table_ref_columnstr Ref column of the metadata table to match against the table , optional
use_table_column_names_as_refbool False
use_metadata_row_names_as_refbool False
Return type:
Table
ANNOTATE_ROWS - @classmethod

Annotate the rows of a table using information from a metadata_table. All the row values of the reference column of the table are matched against the ids of the metadata_table. If an id matches against a reference value of the table, the corresponding row of the table is tagged with the metadata given by the id.

                     If None or empty, the first column is used, defaults to None
                             If None or empty, the first column is used, defaults to None

:raises BadRequestException: description

Parameters:
NameTypeDefault valueDescription
tableTable The table to annotate :param table_ref_column: ref column of the table to match against the metadata table :type table_ref_column: str, optional
metadata_tableTable The metadata table :param metadata_table_ref_column: ref column of the metadata table to match against the table :type metadata_table_ref_column: str, optional
table_ref_columnstr Ref column of the table to match against the metadata table , optional
metadata_table_ref_columnstr Ref column of the metadata table to match against the table , optional
use_table_row_names_as_refbool False
use_metadata_row_names_as_refbool False
Return type:
Table