Skip to content

Instantly share code, notes, and snippets.

@jeremyyeo
Created April 16, 2025 23:46
Show Gist options
  • Save jeremyyeo/5ee966a4f869ad94b3e64edfc687c60f to your computer and use it in GitHub Desktop.
Save jeremyyeo/5ee966a4f869ad94b3e64edfc687c60f to your computer and use it in GitHub Desktop.
Pseudo-sleep function for BQ
create or replace function dbt_jyeo.fake_sleep(seconds int64)
returns string
language python
options(runtime_version="python-3.11", entry_point="main")
as r'''
# python function takes time to spin up so this is a lower bound (wait at minimum).
import time
def main(seconds):
time.sleep(seconds)
return f'waited at least {seconds} seconds'
''';
select dbt_jyeo.fake_sleep(120);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment