Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit 46d13ce

Browse files
feat: rewriting str as Enums
1 parent 939f274 commit 46d13ce

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

supabase_functions/_async/functions_client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ async def invoke(
9595
response_type = invoke_options.get("responseType", "text/plain")
9696

9797
region = invoke_options.get("region")
98-
if not isinstance(region, FunctionRegion):
99-
warn(f"Use FunctionRegion({region})")
100-
region = FunctionRegion(region)
98+
if region:
99+
if not isinstance(region, FunctionRegion):
100+
warn(f"Use FunctionRegion({region})")
101+
region = FunctionRegion(region)
101102

102-
if region and region.value != "any":
103-
headers["x-region"] = region.value
103+
if region.value != "any":
104+
headers["x-region"] = region.value
104105

105106
body = invoke_options.get("body")
106107
if isinstance(body, str):

0 commit comments

Comments
 (0)