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

Serp api query if input columns are empty #854

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Serp api query if input columns are empty #854

merged 1 commit into from
Jul 17, 2024

Conversation

rajasbansal
Copy link
Contributor

Pull Review Summary

Description

Serp api query if input columns are empty. Currently, if the inputs are empty i.e None, we send the string None to google. We should probably change that to an empty string by explicitly filtering this dictionary

Type of change

  • Bug fix (change which fixes an issue)

Tests

@rajasbansal rajasbansal requested review from yadavsahil197, Abhinav-Naikawadi and nihit and removed request for yadavsahil197 June 17, 2024 21:24
@@ -105,7 +105,9 @@ async def _apply(self, row: Dict[str, Any]) -> Dict[str, Any]:
logger.error(
f"Missing query column: {col} in row {row}",
)
query = self.query_template.format_map(defaultdict(str, row))
query = self.query_template.format_map(
Copy link
Contributor

Choose a reason for hiding this comment

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

can we also handle the case when all input columns are empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what does that mean? The default dict changes all empty columns to ""

Copy link
Contributor

@Abhinav-Naikawadi Abhinav-Naikawadi Jun 17, 2024

Choose a reason for hiding this comment

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

I think perhaps we don't make query if no query columns present in row?

Copy link
Contributor

@Abhinav-Naikawadi Abhinav-Naikawadi left a comment

Choose a reason for hiding this comment

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

makes sense, lgtm after addressing other comment!

@rajasbansal rajasbansal merged commit d578a77 into main Jul 17, 2024
2 checks passed
@rajasbansal rajasbansal deleted the serp branch July 17, 2024 20:13
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.

3 participants