Skip to content

feat: add region as forceFunctionRegion query parameter - #1236

Merged
grdsdev merged 3 commits into
mainfrom
feat/add-force-function-region-query-param
Oct 1, 2025
Merged

grdsdev merged 3 commits into
mainfrom
feat/add-force-function-region-query-param

Conversation

@grdsdev

@grdsdev grdsdev commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

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

coveralls commented Sep 30, 2025 •

Copy link
Copy Markdown

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 a team and o-santi September 30, 2025 20:13
@grdsdev
grdsdev merged commit 8b4b56c into main Oct 1, 2025
@grdsdev
grdsdev deleted the feat/add-force-function-region-query-param branch October 1, 2025 14:09
zeekay pushed a commit to Dream-AI-4444/supabase-py that referenced this pull request Sep 10, 2026
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