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

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

                Author: ASF GitHub Bot
            Created on: 12/Apr/18 18:15
            Start Date: 12/Apr/18 18:15
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on a change in pull request 
#5024: [BEAM-4011] Unify Python IO glob implementation.
URL: https://github.com/apache/beam/pull/5024#discussion_r181169858
 
 

 ##########
 File path: sdks/python/apache_beam/io/filesystem.py
 ##########
 @@ -498,9 +501,47 @@ def mkdirs(self, path):
     raise NotImplementedError
 
   @abc.abstractmethod
+  def has_dirs(self):
+    """Whether this FileSystem supports directories."""
+    raise NotImplementedError
+
+  @abc.abstractmethod
+  def list(self, dir_or_prefix):
+    """List files in a location.
+
+    Listing is non-recursive (for filesystems that support directories).
+
+    Args:
+      dir_or_prefix: (string) A directory or location prefix (for filesystems
+        that don't have directories).
+
+    Returns:
+      Generator of ``FileMetadata`` objects.
+
+    Raises:
+      ``BeamIOError`` if listing fails, but not if no files were found.
+    """
+    raise NotImplementedError
+
+  @staticmethod
+  def _url_dirname(url_or_path):
+    """Like posixpath.dirname, but preserves scheme:// prefix.
+
+    Args:
+      url_or_path: A string in the form of scheme://some/path OR /some/path.
+    """
+    match = re.match(r'([a-z]+://)(.*)', url_or_path)
+    if match is None:
+      return posixpath.dirname(url_or_path)
+    url_prefix, path = match.groups()
+    return url_prefix + posixpath.dirname(path)
+
   def match(self, patterns, limits=None):
     """Find all matching paths to the patterns provided.
 
+    Pattern matching is done using fnmatch.fnmatch.
 
 Review comment:
   I think we should clarify if match for \<path\>/* is recursive or not. I 
think most users will use a pattern in the form \<path\>/\<prefix\>* which to 
avoid matching all sub-directories anyways.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 90519)

> Python SDK: add glob support for HDFS
> -------------------------------------
>
>                 Key: BEAM-4011
>                 URL: https://issues.apache.org/jira/browse/BEAM-4011
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Udi Meiri
>            Assignee: Udi Meiri
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to