You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/09/04 12:08:00 UTC

[jira] [Work logged] (BEAM-4747) Python LocalFileSystem directory-creation semantics

     [ https://issues.apache.org/jira/browse/BEAM-4747?focusedWorklogId=306291&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-306291 ]

ASF GitHub Bot logged work on BEAM-4747:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Sep/19 12:07
            Start Date: 04/Sep/19 12:07
    Worklog Time Spent: 10m 
      Work Description: elwinarens commented on pull request #5903: [BEAM-4747] mkdirs if they don't exist in localfilesystem
URL: https://github.com/apache/beam/pull/5903#discussion_r320722059
 
 

 ##########
 File path: sdks/python/apache_beam/io/localfilesystem.py
 ##########
 @@ -217,6 +224,10 @@ def rename(self, source_file_names, destination_file_names):
     def _rename_file(source, destination):
       """Rename a single file object"""
       try:
+        parent = os.path.dirname(destination)
+        if not os.path.exists(parent):
+          os.makedirs(parent)
+
 
 Review comment:
   Could have used `os.renames` instead
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 306291)
    Time Spent: 2h 50m  (was: 2h 40m)

> Python LocalFileSystem directory-creation semantics
> ---------------------------------------------------
>
>                 Key: BEAM-4747
>                 URL: https://issues.apache.org/jira/browse/BEAM-4747
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>    Affects Versions: 2.5.0
>            Reporter: Ryan Williams
>            Assignee: Ryan Williams
>            Priority: Minor
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Coming out of discussion on [BEAM-4742|https://issues.apache.org/jira/browse/BEAM-4742] / [#5903|https://github.com/apache/beam/pull/5903] is a question of whether {{LocalFileSystem.&#123;open,create,copy,rename&#125;}} should create intermediate (destination) directories, or fail with {{IOError}}'s (as the stdlib {{os}} module generally will).
> If the semantics of {{LocalFileSystem}} should mimic those of distributed filesystems (in the spirit of [recent discussion about {{DirectRunner}} being more like a local simulation of a distributed runner than a production-grade local runner|https://www.mail-archive.com/dev@beam.apache.org/msg08410.html]), then this makes sense, and it sounds like [~lcwik] and [~angoenka] are in favor of this interpretation.
> I'll repurpose [#5903|https://github.com/apache/beam/pull/5903] to this end unless I hear otherwise.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)