Skip to content

Conversation

o-santi
Copy link
Contributor

@o-santi o-santi commented Oct 17, 2025

What kind of change does this PR introduce?

Fix #1260 by moving .explain to a class that returns a different type, and removing the necessity to have the branching in the main object. In order to keep the same behavior, if the user requests for a format="json", it will correctly pick up the inferred type of the response as APIResponse, while a barebones explain() should return a str, corresponding to the text of the response.

I've also added overloads for mypy to correctly differentiate between these different cases when the format is known.

Additional context

There's an additional .csv method in BaseRPCRequestBuilder that I'm not sure makes sense to exist.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 18599924123

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 28 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.05%) to 93.876%

Files with Coverage Reduction New Missed Lines %
src/postgrest/base_request_builder.py 6 91.15%
src/postgrest/_sync/request_builder.py 11 90.84%
src/postgrest/_async/request_builder.py 11 90.84%
Totals Coverage Status
Change from base Build 18506419249: -0.05%
Covered Lines: 8799
Relevant Lines: 9373

💛 - Coveralls

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.

Bad return type on the execute method

3 participants