Skip to content

Conversation

grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Sep 30, 2025

Summary

This PR ports the region query parameter feature from functions-js#100 to supabase-py.

  • Updated AsyncFunctionsClient and SyncFunctionsClient to add region as both x-region header and forceFunctionRegion query param
  • Used urllib.parse.urlencode to properly construct query parameters
  • Added comprehensive tests to verify both header and query parameter functionality
  • Updated existing tests to check for both region mechanisms
  • Maintains backward compatibility with existing x-region header

Changes

  • Modified src/functions/src/supabase_functions/_async/functions_client.py
  • Modified src/functions/src/supabase_functions/_sync/functions_client.py
  • Updated src/functions/tests/_async/test_function_client.py
  • Updated src/functions/tests/_sync/test_function_client.py

Test Plan

  • ✅ All existing functions tests pass (64 passed, 1 skipped)
  • ✅ Updated region tests verify both header and query parameter are set
  • ✅ Backward compatibility maintained - existing functionality unchanged

References

🤖 Generated with Claude Code

grdsdev and others added 2 commits September 30, 2025 16:51
- Updated FunctionsClient (both async and sync) to add region as both x-region header and forceFunctionRegion query param
- Used urllib.parse.urlencode to properly construct query parameters
- Added comprehensive tests to verify both header and query parameter functionality
- Updated existing tests to check for both region mechanisms
- Maintains backward compatibility with existing x-region header

Ported from supabase/functions-js#100

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coveralls
Copy link

coveralls commented Sep 30, 2025

Pull Request Test Coverage Report for Build 18163981484

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.007%) to 93.871%

Files with Coverage Reduction New Missed Lines %
src/supabase_functions/_sync/functions_client.py 1 97.1%
src/supabase_functions/_async/functions_client.py 1 97.1%
Totals Coverage Status
Change from base Build 18109183366: 0.007%
Covered Lines: 8714
Relevant Lines: 9283

💛 - Coveralls

@grdsdev grdsdev requested review from o-santi and a team September 30, 2025 20:13
@grdsdev grdsdev merged commit 8b4b56c into main Oct 1, 2025
10 checks passed
@grdsdev grdsdev deleted the feat/add-force-function-region-query-param branch October 1, 2025 14:09
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.

4 participants