Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit c77023f

Browse files
error fast on too little memory
1 parent 33cd4b4 commit c77023f

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

bigframes/functions/_function_client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,9 @@ def get_remote_function_specs(self, remote_function_name):
742742

743743
def _infer_milli_cpus_from_memory(memory_mib: int) -> int:
744744
# observed values, not formally documented by cloud run functions
745-
if memory_mib <= 128:
746-
return 83
747-
elif memory_mib <= 256:
748-
return 167
749-
elif memory_mib <= 512:
745+
if memory_mib < 512:
746+
raise ValueError("Cloud run supports at minimum 512MiB per instance")
747+
elif memory_mib == 512:
750748
return 333
751749
elif memory_mib <= 1024:
752750
return 583

tests/system/large/functions/test_remote_function.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,12 +2169,8 @@ def square(x: int) -> int:
21692169
pytest.param(32769, id="set-32769-too-high"),
21702170
],
21712171
)
2172-
@pytest.mark.flaky(retries=2, delay=120)
21732172
def test_remote_function_gcf_memory_unsupported(session, memory_mib):
2174-
with pytest.raises(
2175-
google.api_core.exceptions.InvalidArgument,
2176-
match="Invalid value specified for container memory",
2177-
):
2173+
with pytest.raises(ValueError, match="Cloud run supports"):
21782174

21792175
@session.remote_function(
21802176
reuse=False,

0 commit comments

Comments
 (0)