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

Hotfix/reddit spacc #5067

Merged
merged 15 commits into from
May 26, 2023
Merged

Conversation

Ltwo3five
Copy link
Contributor

Description

Summary of the change / bug fix.

Using finviz.get_stock(t_ticker[0]) to validate the tickers in a for loop throws error 429 which causes some tickers that were mentioned in the reddit posts on r/spacc to not appear in the result
I used screener_view from finvizfinance to return a list of all tickers to compare against instead.
Additionally the function print_rich_table has logic which was converting any column entry that is not a time stamp into a numeric value. praw.models.reddit.subreddit.Subreddit class could not be converted into int which throws a value error, and if it is not converted into the correct type when the dataframe is converted into JSON, a recursion error will be thrown.
My solution was to convert all column entries into strings in the except block

- Link # issue, if applicable.

#4929

- Screenshot of the feature or the bug before/after fix, if applicable.

tables are now printing when command is run

spacc1

- List any dependencies that are required for this change.

  finvizfinance

How has this been tested?

End to End tests and running existing tests

Please describe the tests that you ran to verify your changes.

Ran all tests to see if changes cause any error

Provide instructions so we can reproduce.

Command /stocks/ba/spacc

Please also list any relevant details for your test configuration.

  • Make sure affected commands still run in terminal
  • Ensure the SDK 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.

@reviewpad reviewpad bot added the feat XS Extra small feature label May 25, 2023
@Ltwo3five Ltwo3five changed the base branch from develop to main May 25, 2023 15:03
@jmaslek
Copy link
Collaborator

jmaslek commented May 25, 2023

Thanks for fixing up the extra files!

something I asked in a previous open PR on this was if you can combine the outputs into a single df so that it doesnt open multiple table windows?

@jmaslek jmaslek changed the base branch from main to develop May 25, 2023 15:34
@Ltwo3five
Copy link
Contributor Author

Ok I will do that

@Ltwo3five
Copy link
Contributor Author

I have pushed the changes

@Ltwo3five Ltwo3five changed the base branch from develop to main May 26, 2023 06:31
@Ltwo3five Ltwo3five changed the base branch from main to develop May 26, 2023 09:00
Copy link
Collaborator

@jmaslek jmaslek left a comment

Choose a reason for hiding this comment

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

Works as advertised! Thanks for the fix!

Screenshot 2023-05-26 at 9 21 52 AM

@jmaslek
Copy link
Collaborator

jmaslek commented May 26, 2023

I just piggybacked and added a quick patch for the wsb prints

@jmaslek jmaslek added this pull request to the merge queue May 26, 2023
Merged via the queue into OpenBB-finance:develop with commit 58391c1 May 26, 2023
@Ltwo3five
Copy link
Contributor Author

Works as advertised! Thanks for the fix!

Screenshot 2023-05-26 at 9 21 52 AM

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat XS Extra small feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants