You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2020/03/06 20:25:23 UTC
[beam] branch master updated: Reduce warnings in pytest runs.
This is an automated email from the ASF dual-hosted git repository.
lcwik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 379aed7 Reduce warnings in pytest runs.
new 403a08f Merge pull request #11016 from udim/warnings
379aed7 is described below
commit 379aed78686cc46f0591cb9dbd35f85f9f42af19
Author: Udi Meiri <eh...@google.com>
AuthorDate: Mon Mar 2 11:48:53 2020 -0800
Reduce warnings in pytest runs.
From 2233 down to 412.
---
sdks/python/apache_beam/io/filesystem.py | 2 +-
sdks/python/apache_beam/io/filesystem_test.py | 4 ++--
sdks/python/apache_beam/runners/dataflow/dataflow_runner.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sdks/python/apache_beam/io/filesystem.py b/sdks/python/apache_beam/io/filesystem.py
index 891132f..c57f133 100644
--- a/sdks/python/apache_beam/io/filesystem.py
+++ b/sdks/python/apache_beam/io/filesystem.py
@@ -694,7 +694,7 @@ class FileSystem(with_metaclass(abc.ABCMeta, BeamPlugin)): # type: ignore[misc]
res = res + re.escape(c)
logger.debug('translate_pattern: %r -> %r', pattern, res)
- return res + r'\Z(?ms)'
+ return r'(?ms)' + res + r'\Z'
def match(self, patterns, limits=None):
"""Find all matching paths to the patterns provided.
diff --git a/sdks/python/apache_beam/io/filesystem_test.py b/sdks/python/apache_beam/io/filesystem_test.py
index 43b2663..dda046f 100644
--- a/sdks/python/apache_beam/io/filesystem_test.py
+++ b/sdks/python/apache_beam/io/filesystem_test.py
@@ -257,9 +257,9 @@ class TestFileSystem(unittest.TestCase):
(join('d', '**', '*'), sep_re.join(['d', double_star, star])),
]
for pattern, expected in pattern__expected:
- expected += r'\Z(?ms)'
+ expected = r'(?ms)' + expected + r'\Z'
result = self.fs.translate_pattern(pattern)
- self.assertEqual(result, expected)
+ self.assertEqual(expected, result)
class TestFileSystemWithDirs(TestFileSystem):
diff --git a/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py b/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
index 56e4f38..654ccfa 100644
--- a/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
+++ b/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
@@ -1537,7 +1537,7 @@ class DataflowPipelineResult(PipelineResult):
# use thread.join() to wait for the polling thread.
thread.daemon = True
thread.start()
- while thread.isAlive():
+ while thread.is_alive():
time.sleep(5.0)
# TODO: Merge the termination code in poll_for_job_completion and