Skip to content
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

Fixing scorr and sentiment dataframe indexing bug #1947

Merged

Conversation

simmonsj330
Copy link
Contributor

@simmonsj330 simmonsj330 commented Jun 15, 2022

Description

Fixes #1883 where sentiment and scorr were not working correctly due to the dataframe running into an indexing error from different length lists

Tested with:
pytest tests/openbb_terminal/stocks/comparison_analysis/test_finbrain_model.py --rewrite-expected
Where it did not change any files so only pushing with one modified file: finabrain_model.py

Screen Shot 2022-06-14 at 10 05 24 PM

Figure_1_sentiment

Figure_1_scorr

  • Summary of the change / bug fix.
  • Link # issue, if applicable.
  • Screenshot of the feature or the bug before/after fix, if applicable.
  • Relevant motivation and context.
  • List any dependencies that are required for this change.
  • Please describe the tests that you ran to verify your changes.
  • Provide instructions so we can reproduce.
  • Please also list any relevant details for your test configuration.

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

@simmonsj330 simmonsj330 added the bug Fix bug label Jun 15, 2022
@simmonsj330 simmonsj330 self-assigned this Jun 15, 2022
@@ -13,6 +13,38 @@
logger = logging.getLogger(__name__)


@log_start_end(log=logger)
def find_smallest_num_data_point(results_list: list) -> int:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note your type hint here should be List[json] like the doctoring.

@simmonsj330 simmonsj330 merged commit 7ea577e into OpenBB-finance:main Jun 20, 2022
@simmonsj330 simmonsj330 deleted the sentiment_scorr_length_bug branch June 29, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug
Projects
None yet
3 participants