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

[Bug] /stocks/ $ news both sources display errors #3236

Closed
hjoaquim opened this issue Nov 1, 2022 · 5 comments
Closed

[Bug] /stocks/ $ news both sources display errors #3236

hjoaquim opened this issue Nov 1, 2022 · 5 comments
Assignees
Labels
bug Fix bug

Comments

@hjoaquim
Copy link
Contributor

hjoaquim commented Nov 1, 2022

  • For /stocks/ $ news --source Feedparser
2022 Nov 01, 07:02 (🦋) /stocks/ $ news --source Feedparser

Fetching data. Please be patient

Error: 'NoneType' object has no attribute 'replace'
  • For /stocks/ $ news --source NewsApi
2022 Nov 01, 07:03 (🦋) /stocks/ $ news --source NewsApi

440 news articles for  Tesla,+Inc. were found since 2022-10-25

                                   Factbox-Teslas Autopilot faces unprecedented scrutiny                                    
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Content                                                                                                                   ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 2022-11-01 10:22:44                                                                                                       │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ By Hyunjoo Jin (Reuters) -   Elon Musk has championed Tesla Inc's driver assistance Autopilot and "Full              │Self-Driving" software as innovations that will both improve road safety and position the electric vehicle maker as a     │
│ technology leader.                                                                                                        │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ https://www.fxempire.com/news/article/factbox-teslas-autopilot-faces-unprecedented-scrutiny-1180983                       │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

...

Error: can only join an iterable
@hjoaquim hjoaquim added the bug Fix bug label Nov 1, 2022
@victortangggg
Copy link
Contributor

victortangggg commented Nov 1, 2022

looking at the help manual, you probably have to include sources, which should be either bloomberg or reuters. I believe u can use other news sources like yahoo or bbc (i [think). #3118

image

image

@hjoaquim
Copy link
Contributor Author

hjoaquim commented Nov 1, 2022

Hey @victortangggg

On this context, source and sources is different. i.e., source (singular) is API where we get the data from and sources (plural) a filter to apply on the data we'll retrieve from the API.

Meaning that we can have data from NewsApi and filter it by choosing we just want to see stuff from bloomberg or reuters.

@victortangggg
Copy link
Contributor

victortangggg commented Nov 1, 2022

@hjoaquim hey hey! ah yes my bad. i see that the error occurs due to having an empty sources variable in the get_news function. Just curious is anyone working that? I am a developer i probably could help.

i'm wondering if user who doesn't specify sources should see all news regardless of sources, or throw a message to specify sources. The first option sounds easier. What do you think?

@hjoaquim
Copy link
Contributor Author

hjoaquim commented Nov 1, 2022

I would probably say the 1st option, as the sources is not a required argument.

@victortangggg as no one is assigned to this yet, I'll assign you.
Feel free to tag me if you need any help or want to change some ideas!
Thanks 😄 !

@victortangggg
Copy link
Contributor

@hjoaquim pardon my noobness with the messy PRs. The final one should be correct. Please let me know if i'm doing this correctly. thanks!

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

No branches or pull requests

2 participants