Repository navigation
Conversation
…uired=False get_international_portfolio filtered the frames and their metadata with different conditions when all_data_items_required is False. The frames kept the tables without "Not Reqd" in the description, which are the "Required" tables, and the metadata kept descriptions ending with "Not Reqd", which the ex-dividend files never do because their descriptions end with " - Ex-Dividends". So with dividends=True the call returned the "All 4 Data Items Required" returns under the "Not Reqd" description, and with dividends=False the metadata list was empty and transform_data raised IndexError. The documented example obb.famafrench.country_portfolio_returns(frequency="annual", measure="local", country="japan", dividends=False, all_data_items_required=False) fails with "[Unexpected Error] -> IndexError -> list index out of range". Filter both lists on "Not Reqd" in the description.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request the OpenBB Platform
Description
The second documented example of
country_portfolio_returnsfails:In
get_international_portfolio, theall_data_items_required is Falsebranch filters the frames and their metadata with different conditions:So with
dividends=Falsethe metadata list is empty andtransform_dataraisesIndexError, for any country or index. Withdividends=Truethe call succeeds but returns the "All 4 Data Items Required" returns under the "Not Reqd" description. For Japan, annual, local, with dividends, the 1975mktvalue is 25.14 for bothall_data_items_required=TrueandFalseondevelop; this branch returns 21.81 forFalse(the "Not Reqd" table) and 25.14 forTrue.The fix filters both lists on
"Not Reqd" in description.How has this been tested?
test_get_international_portfolio_all_data_items_not_required(with and without the " - Ex-Dividends" suffix). Both cases fail ondevelop(assert [2.0] == [1.0], the "Required" frame comes back) and pass with the change.Checklist
feature/feature-nameorhotfix/hotfix-name.