You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2022/03/22 17:26:00 UTC

[jira] [Commented] (BEAM-13493) fileio calls mkdirs with basepath and not dirname(full_file_name)

    [ https://issues.apache.org/jira/browse/BEAM-13493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17510774#comment-17510774 ] 

Beam JIRA Bot commented on BEAM-13493:
--------------------------------------

This issue is P2 but has been unassigned without any comment for 60 days so it has been labeled "stale-P2". If this issue is still affecting you, we care! Please comment and remove the label. Otherwise, in 14 days the issue will be moved to P3.

Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed explanation of what these priorities mean.


> fileio calls mkdirs with basepath and not dirname(full_file_name)
> -----------------------------------------------------------------
>
>                 Key: BEAM-13493
>                 URL: https://issues.apache.org/jira/browse/BEAM-13493
>             Project: Beam
>          Issue Type: Bug
>          Components: io-py-files
>    Affects Versions: 2.34.0, 2.35.0
>            Reporter: Javier Domingo Cansino
>            Priority: P2
>              Labels: stale-P2
>
> When calling {{apache_beam.io.fileio.WriteToFiles}} with a {{file_naming}} argument that adds a directory to the path, the current implementation fails to write files if a {{mkdirs}} or analogous call is needed in the underlying file storage.
> Example, 
> {code}
> apache_beam.io.fileio.WriteToFiles(
>     path="some/base/dir", sink=..., destination=lambda x: "events",
>     file_naming=lambda *x: "subdir/file.txt"
> ) 
> {code}
> the current fileio implementation will call {{mkdirs}} with {{some/base/dir}} instead of {{some/base/dir/subdir}}.
> The bug is currently at https://github.com/apache/beam/blob/67bcf1e16e3fdf68cdea7a4b42b9c003e4b8948c/sdks/python/apache_beam/io/fileio.py#L605.
> ====
> Personally, I would recommend changing the FileSystems interface to have `open` call `mkdirs` in storages that require root parent directory creation.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)