Skip to content

Bad return type on the execute method #1260

@silentworks

Description

@silentworks

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

This has been an issue for a long time but it didn't surface until we decided to enforce mypy for type checking in this repo. The .execute method inside of the SyncQueryRequestBuilder and AsyncQueryRequestBuilder is trying to handle too many use cases and in one (csv) of the case it's not even used anymore. The method is currently returning both a APIResponse object and just plain str.

We should extract any code that is returning a str into its own execute method in a different class. This is already done for the .csv method as it uses an execute method from the SyncSingleRequestBuilder and AsyncSingleRequestBuilder class. The same need to be done for the .explain method and it should just return a str and no objects at all.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '…'
  2. Click on '…'
  3. Scroll down to '…'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • Version of supabase-py: 2.21.1

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpythonPull requests that update Python code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions