The Sector Schemes Data Blocks (SectorSchemes) Data Block is a System Data Block and is not edited. The following details are informational only.
The Sector Schemes (SectorSchemes) Data Block retrieves sector scheme data from the local database. It checks if any data is available, and if so, it processes each row by extracting the Key
and Value
for each sector scheme. The Sector Schemes (SectorSchemes) Data Block then organizes this information into a list and sends it back as the response. This Data Block is not edited.
Data Retrieval: The Sector Schemes (SectorSchemes) Data Block queries the Sector Schemes
database to fetch data into a DataFrame (data_df
). If data_df
contains any rows, the Sector Schemes (SectorSchemes) Data Block iterates through each row. For each row, the SectorSchemes (SectorSchemesLocalDB) Data Block extracts the Key
and Value
columns and appends them to the outputlist
.
Response: The outputlist
(containing dictionaries for each row) is assigned to response["data"]
, making it the final output of the SectorSchemes (SectorSchemesLocalDB) Data Block.
General Info #
The following table shows the default fields of the Data Block.
Field | Value |
---|---|
Name | SectorSchemes |
Block Category | Transformation |
Block Type | Python |
Data Category | None |
Output Type | Data Table |
Dependencies #
The following table shows the default dependencies of the Data Block.
Data Block | Description |
---|---|
CalculationEnv | [Link] |
SectorSchemesLocalDB | [Link] |
Columns #
None
Example Definition #
outputlist=[]
data_df = pd.DataFrame(read("SectorSchemesLocalDB",{})["data"])
if data_df.shape[0]>0:
for i in range(0, data_df.shape[0]):
outputlist.append({ "Key": data_df.loc[i,"Key"],"Value": data_df.loc[i,"Value"]})
response["data"] = outputlist
Example Request #
The following code shows an example request using the default values of the Data Block.
{}
Example Response #
The following code shows an example response using the default values of the Data Block. The default data source is the Assette Snowflake Demo Instance. The response may be shortened for brevity.
{
"data": [
{
"Key": "GICS",
"Value": "GICS Sector"
}
],
"errors": [],
"success": true,
"logs": []
}