Shared
The shared metadata objects are the second layer of metadata. They might be loaded depending on the package using them. They run advanced validation and consistency checks. They also provide advanced functionality to metadata fields like jinja templating.
Jobs
DB2FS
Bases: BaseModel
Class for advanced or shared DB2FS functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
DB2FS
|
|
required |
dataset_types |
DatasetTypes
|
|
required |
databases |
Databases
|
|
required |
data_source_infos |
dict[UUID, DataSourceInfo]
|
|
required |
connections |
Connections
|
|
required |
Source code in cloe_metadata/shared/jobs/db2fs.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
data_source_info: repository.DataSourceInfo
property
Returns the data source info object.
dataset_type: base.DatasetType
property
Returns the dataset type object.
rendered_folder_path: str
property
Renders and returns the folder path using Jinja2 templates.
The following variables can be used in the Jinja template:
content: The content of the data source info's base object.sourcesystem_name: The name of the source system.tenant: The name of the tenant (if available).object_description: The description of the base object.ds_type_name: The name of the dataset type.
Example Jinja template:
{% if tenant %}
/{{ tenant }}/{{ sourcesystem_name }}/{{ ds_type_name }}/
{% else %}
/{{ sourcesystem_name }}/{{ ds_type_name }}/
{% endif %}
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The rendered folder path. |
rendered_select_query: str
property
Renders and returns the select query using Jinja2 templates.
The following variables can be used in the Jinja template:
source_table_identifier: The identifier for the source table.source_table: The source table object.source_columns: The columns of the source table.source_sourcesystem_name: The name of the source system.source_datasettype_name: The name of the dataset type.source_datasettype_type: The storage format of the dataset type.sequence_column_name: The name of the sequence column.
Example Jinja template:
SELECT {{ source_columns | join(', ') }}
FROM {{ source_table_identifier }}
WHERE {{ sequence_column_name }} > :last_sequence_value
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The rendered select query. |
sink_connection: base.Connection
property
Returns the sink connection object.
source_connection: base.Connection
property
Returns the source connection object.
source_table: base.Table
property
Returns the source table object.
data_source_infos_exists(value, info)
classmethod
Validates that the data source info exists.
Source code in cloe_metadata/shared/jobs/db2fs.py
36 37 38 39 40 41 42 43 44 45 | |
dataset_type_exists(value, info)
classmethod
Validates that the dataset type exists.
Source code in cloe_metadata/shared/jobs/db2fs.py
24 25 26 27 28 29 30 31 32 33 34 | |
sink_connection_exists(value, info)
classmethod
Validates that the sink connection exists in the connections.
Source code in cloe_metadata/shared/jobs/db2fs.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
tables_exists(value, info)
classmethod
Validates that the tables exist in the databases.
Source code in cloe_metadata/shared/jobs/db2fs.py
47 48 49 50 51 52 53 54 | |
ExecSQL
Bases: BaseModel
Base class for loading ExecSQL model objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
ExecSQL
|
|
required |
connections |
Connections
|
|
required |
Source code in cloe_metadata/shared/jobs/exec_sql.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
sink_connection: base.Connection
property
Returns the sink connection object.
Returns:
| Type | Description |
|---|---|
Connection
|
base.Connection: The sink connection object. |
get_procedure_name()
Returns the stored procedure name based on the ExecSQL name.
The name is formatted to be lowercase and spaces are replaced with underscores.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The formatted stored procedure name. |
Source code in cloe_metadata/shared/jobs/exec_sql.py
66 67 68 69 70 71 72 73 74 75 | |
get_rendered_runtimes()
Returns a list of rendered SQL queries sorted by execution order.
The queries are rendered using the base_models.get_rendered_query method.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: A list of rendered SQL queries. |
Source code in cloe_metadata/shared/jobs/exec_sql.py
52 53 54 55 56 57 58 59 60 61 62 63 64 | |
sink_connection_exists(value, info)
classmethod
Validates that the connection exists in the connections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Connections
|
The connections object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the connection_id does not exist in the connections. |
Returns:
| Type | Description |
|---|---|
|
base.Connections: The validated connections object. |
Source code in cloe_metadata/shared/jobs/exec_sql.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
FS2DB
Bases: BaseModel
Class for advanced or shared FS2DB functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
FS2DB
|
|
required |
dataset_types |
DatasetTypes
|
|
required |
databases |
Databases
|
|
required |
connections |
Connections
|
|
required |
exec_sqls |
dict[UUID, ExecSQL]
|
|
required |
Source code in cloe_metadata/shared/jobs/fs2db.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
dataset_type: base.DatasetType
property
Returns the dataset type object.
postload_execjob: jobs.ExecSQL | None
property
Returns the post-load exec job if it exists.
rendered_filename_pattern: str
property
Renders and returns the filename pattern using Jinja2 templates.
The following variables can be used in the Jinja template:
ds_type_name: The name of the dataset type.ds_type_format: The storage format of the dataset type.
Example Jinja template:
{{ ds_type_name }}_{{ ds_type_format }}_file
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The rendered filename pattern. |
rendered_folder_path_pattern: str
property
Renders and returns the folder path pattern using Jinja2 templates.
The following variables can be used in the Jinja template:
ds_type_name: The name of the dataset type.ds_type_format: The storage format of the dataset type.
Example Jinja template:
/data/{{ ds_type_name }}/{{ ds_type_format }}/
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The rendered folder path pattern. |
sink_connection: base.Connection
property
Returns the sink connection object.
sink_table: base.Table
property
Returns the sink table object.
source_connection: base.Connection
property
Returns the source connection object.
dataset_type_exists(value, info)
classmethod
Validates that the dataset type exists.
Source code in cloe_metadata/shared/jobs/fs2db.py
22 23 24 25 26 27 28 29 30 31 32 | |
exec_sql_exists(value, info)
classmethod
Validates that the post-load exec job exists in exec SQLs.
Source code in cloe_metadata/shared/jobs/fs2db.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
sink_connection_exists(value, info)
classmethod
Validates that the sink connection exists in the connections.
Source code in cloe_metadata/shared/jobs/fs2db.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
tables_exists(value, info)
classmethod
Validates that the sink table exists in the databases.
Source code in cloe_metadata/shared/jobs/fs2db.py
34 35 36 37 38 39 40 41 | |
Modeler
ColumnMapping
Bases: BaseModel
Class for advanced or shared ColumnMapping functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
ColumnMapping
|
|
required |
databases |
Databases
|
|
required |
conversions |
ConversionTemplates
|
|
required |
Source code in cloe_metadata/shared/modeler/dataflow/column_mapping.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
sink_schema_table: tuple[base.Schema | None, base.Table | None]
property
sink_table: base.Table | None
property
Returns the sink table object.
Returns:
| Type | Description |
|---|---|
Table | None
|
base.Table | None: The sink table object, or None if it does not exist. |
conversion_exists(value, info)
classmethod
Validates that the conversion template exists in the conversion templates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
ConversionTemplates
|
The conversion templates object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the convert_to_datatype does not exist in the conversion templates. |
Returns:
| Type | Description |
|---|---|
|
base.ConversionTemplates: The validated conversion templates object. |
Source code in cloe_metadata/shared/modeler/dataflow/column_mapping.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
sink_table_exists(value, info)
classmethod
Validates that the sink table exists in the databases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Databases
|
The databases object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the sink_table_id does not exist in the databases. |
Returns:
| Type | Description |
|---|---|
|
base.Databases: The validated databases object. |
Source code in cloe_metadata/shared/modeler/dataflow/column_mapping.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
Dataflow
Bases: BaseModel
Class for advanced or shared Dataflow functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
Dataflow
|
|
required |
shared_lookups |
list[Lookup]
|
|
required |
shared_source_tables |
list[SourceTable]
|
|
required |
shared_column_mappings |
list[ColumnMapping]
|
|
required |
databases |
Databases
|
|
required |
sql_templates |
SQLTemplates
|
|
required |
Source code in cloe_metadata/shared/modeler/dataflow/dataflow.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
sink_schema_table: tuple[base.Schema | None, base.Table | None]
property
sink_table: base.Table | None
property
Returns the sink table object.
Returns:
| Type | Description |
|---|---|
Table | None
|
base.Table | None: The sink table object, or None if it does not exist. |
sql_template: base.SQLTemplate | None
property
Returns the SQL template object.
Returns:
| Type | Description |
|---|---|
SQLTemplate | None
|
base.SQLTemplate | None: The SQL template object, or None if it does not exist. |
sink_table_exists(value, info)
classmethod
Validates that the sink table exists in the databases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Databases
|
The databases object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the sink_table_id does not exist in the databases. |
Returns:
| Type | Description |
|---|---|
|
base.Databases: The validated databases object. |
Source code in cloe_metadata/shared/modeler/dataflow/dataflow.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
sql_template_exists(value, info)
classmethod
Validates that the SQL template exists in the SQL templates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
SQLTemplates
|
The SQL templates object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the sql_template_id does not exist in the SQL templates. |
Returns:
| Type | Description |
|---|---|
|
base.SQLTemplates: The validated SQL templates object. |
Source code in cloe_metadata/shared/modeler/dataflow/dataflow.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
Lookup
Bases: BaseModel
Class for advanced or shared Lookup functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
Lookup
|
|
required |
shared_return_column_mapping |
list[ReturnColumnMapping]
|
|
required |
databases |
Databases
|
|
required |
Source code in cloe_metadata/shared/modeler/dataflow/lookup.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
source_schema_table: tuple[base.Schema | None, base.Table | None]
property
source_table: base.Table | None
property
Returns the source table object.
Returns:
| Type | Description |
|---|---|
Table | None
|
base.Table | None: The source table object, or None if it does not exist. |
tenant_exists(value, info)
classmethod
Validates that the lookup table exists in the databases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Databases
|
The databases object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the lookup_table_id does not exist in the databases. |
Returns:
| Type | Description |
|---|---|
|
base.Databases: The validated databases object. |
Source code in cloe_metadata/shared/modeler/dataflow/lookup.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
ReturnColumnMapping
Bases: BaseModel
Class for advanced or shared ReturnColumnMapping functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
ReturnColumnMapping
|
|
required |
databases |
Databases
|
|
required |
Source code in cloe_metadata/shared/modeler/dataflow/lookup.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
sink_schema_table: tuple[base.Schema | None, base.Table | None]
property
sink_table: base.Table | None
property
Returns the sink table object.
Returns:
| Type | Description |
|---|---|
Table | None
|
base.Table | None: The sink table object, or None if it does not exist. |
tenant_exists(value, info)
classmethod
Validates that the sink table exists in the databases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Databases
|
The databases object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the sink_table_id does not exist in the databases. |
Returns:
| Type | Description |
|---|---|
|
base.Databases: The validated databases object. |
Source code in cloe_metadata/shared/modeler/dataflow/lookup.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
SourceTable
Bases: BaseModel
Class for advanced or shared SourceTable functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
SourceTable
|
|
required |
databases |
Databases
|
|
required |
tenants |
Tenants
|
|
required |
Source code in cloe_metadata/shared/modeler/dataflow/source_table.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
source_schema_table: tuple[base.Schema | None, base.Table | None]
property
source_table: base.Table | None
property
Returns the source table object.
Returns:
| Type | Description |
|---|---|
Table | None
|
base.Table | None: The source table object, or None if it does not exist. |
tenant: base.Tenant | None
property
Returns the tenant object.
Returns:
| Type | Description |
|---|---|
Tenant | None
|
base.Tenant | None: The tenant object, or None if it does not exist. |
table_exists(value, info)
classmethod
Validates that the source table exists in the databases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Databases
|
The databases object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the table_id does not exist in the databases. |
Returns:
| Type | Description |
|---|---|
|
base.Databases: The validated databases object. |
Source code in cloe_metadata/shared/modeler/dataflow/source_table.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
tenant_exists(value, info)
classmethod
Validates that the tenant exists in the tenants.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Tenants
|
The tenants object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the tenant_id does not exist in the tenants. |
Returns:
| Type | Description |
|---|---|
|
base.Tenants: The validated tenants object. |
Source code in cloe_metadata/shared/modeler/dataflow/source_table.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
CustomDataflow
Bases: BaseModel
Class for advanced or shared CustomDataflow functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
CustomDataflow
|
|
required |
shared_table_mappings |
list[TableMapping]
|
|
required |
Source code in cloe_metadata/shared/modeler/custom_dataflow/custom_dataflow.py
11 12 13 14 15 | |
TableMapping
Bases: BaseModel
Class for advanced or shared TableMapping functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
TableMapping
|
|
required |
databases |
Databases
|
|
required |
Source code in cloe_metadata/shared/modeler/custom_dataflow/table_mapping.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
sink_schema_table: tuple[base.Schema | None, base.Table | None]
property
sink_table: base.Table | None
property
Returns the sink table object.
Returns:
| Type | Description |
|---|---|
Table | None
|
base.Table | None: The sink table object, or None if it does not exist. |
source_schema_table: tuple[base.Schema | None, base.Table | None]
property
source_table: base.Table | None
property
Returns the source table object.
Returns:
| Type | Description |
|---|---|
Table | None
|
base.Table | None: The source table object, or None if it does not exist. |
sink_table_exists(value, info)
classmethod
Validates that the sink and source tables exist in the databases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Databases
|
The databases object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If either the sink_table_id or source_table_id do not exist in the databases. |
Returns:
| Type | Description |
|---|---|
|
base.Databases: The validated databases object. |
Source code in cloe_metadata/shared/modeler/custom_dataflow/table_mapping.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Repository
DataSourceInfo
Bases: BaseModel
Class for advanced or shared DataSourceInfo functionality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_obj |
DataSourceInfo
|
|
required |
sourcesystems |
Sourcesystems
|
|
required |
tenants |
Tenants
|
|
required |
Source code in cloe_metadata/shared/repository/data_source_info.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
sourcesystem: base.Sourcesystem
property
Returns the source system object.
Returns:
| Type | Description |
|---|---|
Sourcesystem
|
base.Sourcesystem: The source system object. |
tenant: base.Tenant | None
property
Returns the tenant object.
Returns:
| Type | Description |
|---|---|
Tenant | None
|
base.Tenant | None: The tenant object, or None if it does not exist. |
sourcesystem_exists(value, info)
classmethod
Validates that the source system exists in the source systems.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Sourcesystems
|
The source systems object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the sourcesystem_id does not exist in the source systems. |
Returns:
| Type | Description |
|---|---|
|
base.Sourcesystems: The validated source systems object. |
Source code in cloe_metadata/shared/repository/data_source_info.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
tenant_exists(value, info)
classmethod
Validates that the tenant exists in the tenants.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
Tenants
|
The tenants object to validate. |
required |
info |
ValidationInfo
|
Information about the field being validated. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the tenant_id does not exist in the tenants. |
Returns:
| Type | Description |
|---|---|
|
base.Tenants: The validated tenants object. |
Source code in cloe_metadata/shared/repository/data_source_info.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |