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

Refactored quote command #3304

Merged
merged 6 commits into from
Nov 5, 2022
Merged

Refactored quote command #3304

merged 6 commits into from
Nov 5, 2022

Conversation

colin99d
Copy link
Contributor

@colin99d colin99d commented Nov 4, 2022

Description

Fixes #3053

Refactors the stocks/quote command to follow MVC, only adds the model to the SDK since the view just shows the same thing. The view would also have the same double showing issue since it needs to print and return the data.

How has this been tested?

  • Make sure affected commands still run in terminal
    • python terminal.py stocks/quote aapl
  • Ensure the SDK still works
    • `openbb.stocks.quote("AAPL")
  • Check any related reports
    • API stayed the same so the report should not be affected

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 Nov 4, 2022
@colin99d colin99d requested a review from jmaslek November 4, 2022 10:57
from openbb_terminal.helper_funcs import print_rich_table


def display_quote(symbol: str) -> pd.DataFrame:
Copy link
Collaborator

Choose a reason for hiding this comment

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

docstring


quote_df = quote_df.set_index("Symbol")

quote_data = transpose(quote_df)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would make me happier if you made this quote_df.T and get rid of the import



def load_quote(symbol: str) -> pd.DataFrame:
"""Ticker quote.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ticker quote [Source: YahooFInance]

@jmaslek
Copy link
Collaborator

jmaslek commented Nov 4, 2022

Working in terminal and sdk!

Screen Shot 2022-11-04 at 9 25 26 AM

@jmaslek jmaslek merged commit 5c975cf into main Nov 5, 2022
@jmaslek jmaslek deleted the fix_3053 branch November 5, 2022 03:00
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] SDK - openbb.stocks.quote prints a dataframe and the terminal view.
2 participants