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

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

                Author: ASF GitHub Bot
            Created on: 14/Jun/18 05:28
            Start Date: 14/Jun/18 05:28
    Worklog Time Spent: 10m 
      Work Description: jbonofre closed pull request #5624: [BEAM-4535] Add a 
custom _url_dirname for local filesystems.
URL: https://github.com/apache/beam/pull/5624
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/python/apache_beam/io/filesystem.py 
b/sdks/python/apache_beam/io/filesystem.py
index 752cb31bd72..8ebb6b5f029 100644
--- a/sdks/python/apache_beam/io/filesystem.py
+++ b/sdks/python/apache_beam/io/filesystem.py
@@ -528,8 +528,7 @@ def _list(self, dir_or_prefix):
     """
     raise NotImplementedError
 
-  @staticmethod
-  def _url_dirname(url_or_path):
+  def _url_dirname(self, url_or_path):
     """Like posixpath.dirname, but preserves scheme:// prefix.
 
     Args:
diff --git a/sdks/python/apache_beam/io/localfilesystem.py 
b/sdks/python/apache_beam/io/localfilesystem.py
index aab68593100..7e7f88d4e45 100644
--- a/sdks/python/apache_beam/io/localfilesystem.py
+++ b/sdks/python/apache_beam/io/localfilesystem.py
@@ -81,6 +81,17 @@ def has_dirs(self):
     """Whether this FileSystem supports directories."""
     return True
 
+  def _url_dirname(self, url_or_path):
+    """Pass through to os.path.dirname.
+
+    This version uses os.path instead of posixpath to be compatible with the
+    host OS.
+
+    Args:
+      url_or_path: A string in the form of /some/path.
+    """
+    return os.path.dirname(url_or_path)
+
   def _list(self, dir_or_prefix):
     """List files in a location.
 


 

----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 111785)
    Time Spent: 1h 10m  (was: 1h)

> Python tests are failing for Windows
> ------------------------------------
>
>                 Key: BEAM-4535
>                 URL: https://issues.apache.org/jira/browse/BEAM-4535
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Chamikara Jayalath
>            Assignee: Udi Meiri
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Error is:
> Traceback (most recent call last):
>   File 
> "C:\Users\deft-testing-integra\python_sdk_download\apache_beam\io\fileba
> sedsource_test.py", line 532, in test_read_auto_pattern
>     compression_type=CompressionTypes.AUTO))
>   File 
> "C:\Users\deft-testing-integra\python_sdk_download\apache_beam\io\fileba
> sedsource.py", line 119, in __init__
>     self._validate()
>   File 
> "C:\Users\deft-testing-integra\python_sdk_download\apache_beam\options\v
> alue_provider.py", line 133, in _f
>     return fnc(self, *args, **kwargs)
>   File 
> "C:\Users\deft-testing-integra\python_sdk_download\apache_beam\io\fileba
> sedsource.py", line 179, in _validate
>     'No files found based on the file pattern %s' % pattern)
> IOError: No files found based on the file pattern 
> c:\windows\temp\tmpwon5_g\mytemp*



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

Reply via email to