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

Improved sorting capabilities in the news function #2682

Merged
merged 13 commits into from
Oct 3, 2022
Merged

Improved sorting capabilities in the news function #2682

merged 13 commits into from
Oct 3, 2022

Conversation

colin99d
Copy link
Contributor

@colin99d colin99d commented Sep 30, 2022

Description

Fixes #2681

How has this been tested?

  • 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.
  • Make sure affected commands still run in terminal
  • Ensure the api still works
  • Check any related reports

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.

@colin99d colin99d added the bug Fix bug label Sep 30, 2022
Copy link
Contributor

@montezdesousa montezdesousa left a comment

Choose a reason for hiding this comment

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

Hey @colin99d, what do you think of moving the sort_values inside the model instead? This way both model and view have the same output and api users have the sorted news dataframe with openbb.common.news(term="UK Pension fund")

Also can you can remove this line from api.py virtual paths? -> "view": "openbb_terminal.common.feedparser_view.display_news"

Does not make sense to expose the view in the api in this case it just prints the news.

@colin99d
Copy link
Contributor Author

colin99d commented Oct 2, 2022

@montezdesousa. Updates made!

@montezdesousa
Copy link
Contributor

montezdesousa commented Oct 3, 2022

@montezdesousa. Updates made!

tks! seems good to me!

@colin99d colin99d merged commit 87fac96 into main Oct 3, 2022
@colin99d colin99d deleted the fix_news branch October 3, 2022 09:44
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
Development

Successfully merging this pull request may close these issues.

[Bug] News does not sort by latest because published is not a DatetimeIndex
2 participants