Skip to content

Commit 3d0ed79

Browse files
Vault: Fix for components comparison (#77)
* fix(scripts): Fixing the component comparsion logic in Vault * fix(scripts): Fixing the component comparsion logic in Vault * Revert "fix(scripts): Fixing the component comparsion logic in Vault" This reverts commit 32f68b1. * fix(scripts): Fixing the component comparsion logic in vault
1 parent cb3a60b commit 3d0ed79

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

examples/vault_engine_multiple_unit_example.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,11 @@ def main():
5353
frequency = "Monthly"
5454

5555
get_components_response = components_api.get_vault_components(vault_document_name)
56-
component_total_returns_summary = ComponentSummary(
57-
name=vault_component_total_returns, category=vault_component_category)
58-
component_total_returns_id = [id for id in list(get_components_response[0].data.keys(
59-
)) if get_components_response[0].data[id] == component_total_returns_summary][0]
56+
component_total_returns_id = [id for id in list(get_components_response[0].data.keys()) if get_components_response[0].data[id].name == vault_component_total_returns and get_components_response[0].data[id].category == vault_component_category][0]
6057
print("Vault Total Returns Component Id: " + component_total_returns_id)
6158

62-
component_performance_summary = ComponentSummary(
63-
name=vault_component_performance, category=vault_component_category)
64-
component_performance_id = [id for id in list(get_components_response[0].data.keys(
65-
)) if get_components_response[0].data[id] == component_performance_summary][0]
59+
60+
component_performance_id = [id for id in list(get_components_response[0].data.keys()) if get_components_response[0].data[id].name == vault_component_performance and get_components_response[0].data[id].category == vault_component_category][0]
6661
print("Vault Performance Over Time Component Id: " +
6762
component_performance_id)
6863

examples/vault_engine_single_unit_example.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ def main():
5252
frequency = "Monthly"
5353

5454
get_components_response = components_api.get_vault_components(vault_document_name)
55-
component_summary = ComponentSummary(
56-
name=vault_component_name, category=vault_component_category)
55+
5756
component_id = [id for id in list(
58-
get_components_response[0].data.keys()) if get_components_response[0].data[id] == component_summary][0]
57+
get_components_response[0].data.keys()) if get_components_response[0].data[id].name == vault_component_name and get_components_response[0].data[id].category == vault_component_category][0]
5958
print("Vault Component Id: " + component_id)
6059
vault_account_identifier = VaultIdentifier(vault_default_account)
6160
vault_dates = VaultDateParameters(

0 commit comments

Comments
 (0)