Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

avinashpipalwa
Copy link
Contributor

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.

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.
Copy link
Contributor

@vamshimupparaju vamshimupparaju left a 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)]

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@@ -49,15 +49,16 @@ def main():
startdate = "20180101"
enddate = "20181231"
frequency = "Monthly"
holdings = "B&H"
Copy link
Contributor

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.

@srajak8 srajak8 requested a review from ksreeramoj August 8, 2022 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants