-
Notifications
You must be signed in to change notification settings - Fork 3
fix(SDK): Added Holdings Mode for PA API Code Snippet #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(SDK): Added Holdings Mode for PA API Code Snippet #92
Conversation
Made the changes as per the requirement. Tested this and can see in the post body the Holdings mode which we passed as an input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
# uncomment the below code line to setup cache control; max-stale=0 will be a fresh adhoc run and the max-stale value is in seconds. | ||
# Results are by default cached for 12 hours; Setting max-stale=300 will fetch a cached result which is 5 minutes older. | ||
# cache_control = "max-stale=0" | ||
get_components_response = components_api.get_pa_components(document=pa_document_name) | ||
component_id = [id for id in list( | ||
get_components_response[0].data.keys()) if get_components_response[0].data[id].name == pa_component_name and get_components_response[0].data[id].category == pa_component_category][0] | ||
print("PA Component Id: " + component_id) | ||
pa_accounts = [PAIdentifier(id=portfolio)] | ||
pa_benchmarks = [PAIdentifier(id=benchmark)] | ||
pa_accounts = [PAIdentifier(id=portfolio,holdingsmode=holdings)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor: please add space after a comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Added a space after comma
@@ -49,15 +49,16 @@ def main(): | |||
startdate = "20180101" | |||
enddate = "20181231" | |||
frequency = "Monthly" | |||
holdings = "B&H" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this better to make the variable name too as holdingsmode
? Also, it may be good to have this variable at line 49 as it is related to accounts and benchmarks.
Made the changes as per the requirement.
Tested this and can see in the post body the Holdings mode which we passed as an input.