Skip to content

Commit 14a775e

Browse files
committed
Fix missing argument
1 parent 998ec1d commit 14a775e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

servicex_codegen/post_operation.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
# Redistribution and use in source and binary forms, with or without
3232
# modification, are permitted provided that the following conditions are met:
3333
#
34+
from tempfile import TemporaryDirectory
35+
3436
from flask import request, Response
3537
from flask_restful import Resource
3638
from servicex_codegen.code_generator import CodeGenerator
@@ -44,14 +46,15 @@ def make_api(cls, code_generator: CodeGenerator):
4446

4547
def post(self):
4648
try:
47-
code = request.data.decode('utf8')
48-
zip_data = self.code_generator.generate_code(code)
49+
with TemporaryDirectory() as tempdir:
50+
code = request.data.decode('utf8')
51+
zip_data = self.code_generator.generate_code(code, cache_path=tempdir)
4952

50-
# Send the response back to you-know-what.
51-
response = Response(
52-
response=zip_data,
53-
status=200, mimetype='application/octet-stream')
54-
return response
53+
# Send the response back to you-know-what.
54+
response = Response(
55+
response=zip_data,
56+
status=200, mimetype='application/octet-stream')
57+
return response
5558
except BaseException as e:
5659
print(str(e))
5760
import traceback

0 commit comments

Comments
 (0)