Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using deprecated method
Browse files Browse the repository at this point in the history
stevemessick committed Jan 13, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 48e9267 commit 1259588
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kaggle/api/kaggle_api.py
Original file line number Diff line number Diff line change
@@ -331,9 +331,9 @@ def kernel_push(self, kernel_push_request): # noqa: E501
"""
with tempfile.TemporaryDirectory() as tmpdir:
meta_file = os.path.join(tmpdir, 'kernel-metadata.json')
code_file = tempfile.mktemp('code','py', tmpdir)
with open(code_file, 'w') as c:
c.write(json.dumps(kernel_push_request.code))
(fd,code_file) = tempfile.mkstemp('code','py', tmpdir, text=True)
fd.write(json.dumps(kernel_push_request.code))
os.close(fd)
with open(meta_file, 'w') as f:
params = kernel_push_request.to_dict()
params['code_file'] = code_file

0 comments on commit 1259588

Please sign in to comment.