jorisvandenbossche commented on a change in pull request #11479:
URL: https://github.com/apache/arrow/pull/11479#discussion_r742948565



##########
File path: docs/source/python/dataset.rst
##########
@@ -15,6 +15,16 @@
 .. specific language governing permissions and limitations
 .. under the License.
 
+.. ipython:: python
+    :suppress:
+
+    # set custom tmp working directory for files that create data
+    import os
+    import tempfile
+
+    temp_working_dir = tempfile.mkdtemp(prefix="pyarrow-")
+    os.chdir(temp_working_dir)

Review comment:
       I currently didn't add an explicit clean-up (but could add a 
`shutil.rmtree(temp_working_directory)` at the end of each of the files using 
this), but so implicitly relied on the "temporary" nature / the OS to do this 
clean-up for us.
   
   Personally I find that sufficient (building the docs seems to already add 
lots of "profile_..." dirs to /tmp, so having a few more "pyarrow-..." 
directories in there doesn't seem to matter much), but as mentioned also easy 
to add an explicit rmtree (it might still be good practice to clean-up even 
when using temporary files?).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to