Skip to content

Newsapi Integration Bugs#7900

Merged
ZoranPandovski merged 3 commits into
stagingfrom
newsapi-fixes
Oct 24, 2023
Merged

Newsapi Integration Bugs#7900
ZoranPandovski merged 3 commits into
stagingfrom
newsapi-fixes

Conversation

@ZoranPandovski
Copy link
Copy Markdown
Member

Description

This PR adds a few changes to the NewsAPI handler:

  1. Check if there is data. If not, return an empty DF instead of throwing a mapping error
  2. Fix the sorting issue by correctly parsing the ORDER BY value
  3. Check if the API call is successful
  4. Set default page API value if the page value is missing

Fixes #7899 , #7897

The unit tests for this handler will be added in separate PR.

Type of change

(Please delete options that are not relevant)

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ⚡ New feature (non-breaking change which adds functionality)
  • 📢 Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • 📄 This change adds a documentation update

Verification Process

To ensure the changes are working as expected, run the following queries:

SELECT *
FROM newsAPI.article
WHERE query = 'mindsdb';

And:

SELECT *
FROM newsAPI.article
WHERE query = 'Python'
AND sources="bbc-news"
AND publishedAt >= "2021-03-23" AND  publishedAt <= "2023-04-23"
LIMIT 4;

Additional Media:

Screenshot from 2023-10-19 15-28-10

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

Copy link
Copy Markdown
Contributor

@MinuraPunchihewa MinuraPunchihewa left a comment

Choose a reason for hiding this comment

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

I've tested this locally and it looks to be working great!

@ZoranPandovski ZoranPandovski merged commit 005209a into staging Oct 24, 2023
@ZoranPandovski ZoranPandovski deleted the newsapi-fixes branch October 24, 2023 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Integrations]: Error Thrown When Sorting NewsAPI articles

2 participants