Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions 13 packages/bigframes/bigframes/functions/_function_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,22 @@ def create_cloud_function(
config = func_def

# Build and deploy folder structure containing cloud function
with tempfile.TemporaryDirectory() as directory:
with tempfile.TemporaryDirectory() as scratch_dir:
# Keep the generated sources in a subdirectory so the archive can be
# written inside the 0700 TemporaryDirectory. shutil.make_archive
# appends ".zip" to base_name, so archiving `directory` into itself
# would leave a world-readable copy of the (pickled) user code as a
# sibling of the temp dir that also survives the cleanup.
directory = os.path.join(scratch_dir, "src")
os.mkdir(directory)
entry_point = self._generate_cloud_function_code(
config.code,
directory,
udf_signature=config.signature,
)
archive_path = shutil.make_archive(directory, "zip", directory)
archive_path = shutil.make_archive(
os.path.join(scratch_dir, "source"), "zip", directory
)

# We are creating cloud function source code from the currently running
# python version. Use the same version to deploy. This is necessary
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.