Data assets
dadosfera.services.maestro.data_assets.fetch_catalog_asset_count
fetch_catalog_asset_count(maestro_base_url, token, additional_params={})
Fetch the total number of data assets from Maestro.
PARAMETER | DESCRIPTION |
---|---|
maestro_base_url
|
Base URL of the Maestro instance (e.g., 'https://maestro.example.com/api').
TYPE:
|
token
|
Authentication token for API access.
TYPE:
|
additional_params
|
Additional query parameters to include in the request. These parameters will override default sorting parameters if there are conflicts. Defaults to {}.
TYPE:
|
Returns: int: Total number of data assets. Raises: requests.exceptions.HTTPError: If the API request fails with a non-200 status code. requests.exceptions.ConnectionError: If there's a network connection error. requests.exceptions.Timeout: If the request times out. requests.exceptions.RequestException: For any other request-related errors. Example: >>> assets = fetch_catalog_asset_count( ... maestro_base_url="https://maestro.example.com/api", ... token="bearer_token_123", ... additional_params = {} ... ) >>> logger.info(assets) 5000
Source code in dadosfera/services/maestro/data_assets.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 |
|
dadosfera.services.maestro.data_assets.fetch_paginated_catalog_assets
fetch_paginated_catalog_assets(maestro_base_url, token, additional_params={}, size=50, start_page=1)
Fetch all data assets from Maestro's catalog using pagination.
This function retrieves the complete list of data assets by making multiple paginated requests to the Maestro catalog API. Assets are sorted by display name in ascending order. If the initial request fails, appropriate error messages will be logged.
PARAMETER | DESCRIPTION |
---|---|
maestro_base_url
|
Base URL of the Maestro instance (e.g., 'https://maestro.example.com/api').
TYPE:
|
token
|
Authentication token for API access.
TYPE:
|
additional_params
|
Additional query parameters to include in the request. These parameters will override default sorting parameters if there are conflicts. Defaults to {}.
TYPE:
|
size
|
Number of data assets to fetch per page. A larger size means fewer API calls but more data per request. Defaults to 50.
TYPE:
|
start_page
|
Page number to start fetching from. Useful for resuming interrupted fetches. Defaults to 1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
List[Dict[str, Any]]
|
List[Dict[str, Any]]: List of data asset objects. Each object contains metadata about a data asset as returned by the Maestro API. |
RAISES | DESCRIPTION |
---|---|
HTTPError
|
If the API request fails with a non-200 status code. |
ConnectionError
|
If there's a network connection error. |
Timeout
|
If the request times out. |
RequestException
|
For any other request-related errors. |
Example: >>> assets = fetch_paginated_catalog_assets( ... maestro_base_url="https://maestro.example.com/api", ... token="bearer_token_123", ... size=100 ... ) >>> logger.info(f"Retrieved {len(assets)} assets")
Source code in dadosfera/services/maestro/data_assets.py
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 |
|
dadosfera.services.maestro.data_assets.get_data_asset_column_metadata
get_data_asset_column_metadata(maestro_base_url, token, data_asset_id, additional_params={})
Fetch detailed column metadata for a data asset.
Retrieves comprehensive metadata about all columns in a specific data asset, including data types, descriptions, and statistical information when available.
PARAMETER | DESCRIPTION |
---|---|
maestro_base_url
|
Base URL of the Maestro instance (e.g., 'https://maestro.example.com/api').
TYPE:
|
token
|
Authentication token for API access. Must have 'catalog:read' permission.
TYPE:
|
data_asset_id
|
Unique identifier of the data asset (e.g., 'asset_abc123').
TYPE:
|
additional_params
|
Additional query parameters. Common parameters include: - include_stats: Include statistical information - include_samples: Include value samples Defaults to {}.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Column metadata information including: - columns (List[Dict]): List of column definitions |
RAISES | DESCRIPTION |
---|---|
HTTPError
|
For failed API requests. Common cases: - 401: Invalid or expired token - 403: Insufficient permissions - 404: Data asset not found |
ConnectionError
|
For network connectivity issues |
Timeout
|
For request timeouts |
RequestException
|
For other request-related errors |
Source code in dadosfera/services/maestro/data_assets.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
dadosfera.services.maestro.data_assets.get_data_asset_data_preview
get_data_asset_data_preview(maestro_base_url, token, data_asset_id, additional_params={})
Fetch a data preview for a specific data asset.
Retrieves a sample of rows from the data asset to preview its content. The preview typically includes a limited number of rows and columns for quick inspection.
PARAMETER | DESCRIPTION |
---|---|
maestro_base_url
|
Base URL of the Maestro instance (e.g., 'https://maestro.example.com/api').
TYPE:
|
token
|
Authentication token for API access. Must have 'catalog:read' permission.
TYPE:
|
data_asset_id
|
Unique identifier of the data asset (e.g., 'asset_abc123').
TYPE:
|
additional_params
|
Additional query parameters. Common parameters include: - limit: Maximum number of rows to return - offset: Number of rows to skip - columns: Specific columns to include Defaults to {}.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Preview data |
RAISES | DESCRIPTION |
---|---|
HTTPError
|
For failed API requests. Common cases: - 401: Invalid or expired token - 403: Insufficient permissions - 404: Data asset not found |
ConnectionError
|
For network connectivity issues |
Timeout
|
For request timeouts |
RequestException
|
For other request-related errors |
Source code in dadosfera/services/maestro/data_assets.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
|
dadosfera.services.maestro.data_assets.get_data_asset_table_metadata
get_data_asset_table_metadata(maestro_base_url, token, data_asset_id, additional_params={})
Fetch comprehensive metadata information about a data asset.
Retrieves detailed metadata about a specific data asset including its general properties, schema information, and configuration details.
PARAMETER | DESCRIPTION |
---|---|
maestro_base_url
|
Base URL of the Maestro instance (e.g., 'https://maestro.example.com/api').
TYPE:
|
token
|
Authentication token for API access. Must have 'catalog:read' permission.
TYPE:
|
data_asset_id
|
Unique identifier of the data asset (e.g., 'asset_abc123').
TYPE:
|
additional_params
|
Additional query parameters to include in the request. Defaults to {}.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Data asset metadata including |
RAISES | DESCRIPTION |
---|---|
HTTPError
|
For failed API requests. Common cases: - 401: Invalid or expired token - 403: Insufficient permissions - 404: Data asset not found |
ConnectionError
|
For network connectivity issues |
Timeout
|
For request timeouts |
RequestException
|
For other request-related errors |
Source code in dadosfera/services/maestro/data_assets.py
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 |
|