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

feat(market): swap to prisma direct query #8246

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

ntindle
Copy link
Member

@ntindle ntindle commented Oct 2, 2024

Background

@aarushik93 requested this change for debugging marketplace issues

Changes πŸ—οΈ

swaps from a prisma raw query to a structured prisma query

Testing πŸ”

Note

Only for the new autogpt platform, currently in autogpt_platform/

  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

@ntindle ntindle requested a review from a team as a code owner October 2, 2024 04:42
@ntindle ntindle requested review from Torantulino and kcze and removed request for a team October 2, 2024 04:42
Copy link

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 πŸ”΅πŸ”΅βšͺβšͺβšͺ
πŸ§ͺΒ No relevant tests
πŸ”’Β No security concerns identified
⚑ Recommended focus areas for review

Performance Concern
The new implementation might be less efficient for large datasets as it retrieves all agents and processes categories in Python, instead of using a database-level aggregation.

Error Handling
The function returns an empty list for all exceptions, which might hide unexpected errors and make debugging difficult.

@github-actions github-actions bot added platform/backend AutoGPT Platform - Back end size/m labels Oct 2, 2024
Copy link

netlify bot commented Oct 2, 2024

βœ… Deploy Preview for auto-gpt-docs canceled.

Name Link
πŸ”¨ Latest commit 89ef855
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/66fd402159ec27000857e964

@ntindle ntindle requested review from aarushik93 and removed request for Torantulino October 2, 2024 04:43
except prisma.errors.PrismaError as e:
raise AgentQueryError(f"Database query failed: {str(e)}")
except Exception as e:
# raise AgentQueryError(f"Unexpected error occurred: {str(e)}")
# Return an empty list of categories in case of unexpected errors
return market.model.CategoriesResponse(unique_categories=[])
Copy link
Contributor

Choose a reason for hiding this comment

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

Why? This won't show up as error now

@aarushik93 aarushik93 merged commit 9748cd0 into master Oct 2, 2024
13 checks passed
@aarushik93 aarushik93 deleted the marketplace-swap-to-prisma-query branch October 2, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: βœ… Done
Development

Successfully merging this pull request may close these issues.

3 participants