Skip to content

[community]: [remove arbitrary return in google results] #939

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cuiqui
Copy link

@cuiqui cuiqui commented May 21, 2025

PR Description

This PR fixes the implementation to match the documented behavior of this method.

Method's documentation clearly states that:

        Returns:
            A list of dictionaries with the following keys:
                snippet - The description of the result.
                title - The title of the result.
                link - The link to the result.

Much to my demise, there's a strange early return

        if len(results) == 0:
            return [{"Result": "No good Google Search Result was found"}]

if no results were found.

There's no need to represent the "emptiness" of results, an empty list takes care of that. In any case, if we need to represent the absence, this is not a sensible null pattern implementation, since the returned object is not even polymorphic wit h what the documentation says.

This PR removes that early return and considers that an empty list correctly represents the absence of results

Relevant issues

Type

🧹 Refactoring
📖 Documentation

Changes(optional)

Testing(optional)

Note(optional)

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.

1 participant