Repository: beam
Updated Branches:
  refs/heads/master 17ab371f1 -> f303b9899


[BEAM-1320] Fix warnings in the beam docstrings


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/d1ac3055
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/d1ac3055
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/d1ac3055

Branch: refs/heads/master
Commit: d1ac30552aebb596ebc5e981976991d26851f3ea
Parents: 17ab371
Author: Sourabh Bajaj <sourabhba...@google.com>
Authored: Wed Feb 22 14:25:26 2017 -0800
Committer: Ahmet Altay <al...@google.com>
Committed: Wed Feb 22 14:59:21 2017 -0800

----------------------------------------------------------------------
 .../examples/complete/autocomplete.py           |  3 ++-
 .../complete/juliaset/juliaset/juliaset.py      |  3 ++-
 sdks/python/apache_beam/io/textio.py            | 23 ++++++++++----------
 sdks/python/generate_pydoc.sh                   | 12 ++++++----
 4 files changed, 23 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/d1ac3055/sdks/python/apache_beam/examples/complete/autocomplete.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/examples/complete/autocomplete.py 
b/sdks/python/apache_beam/examples/complete/autocomplete.py
index 3f2a7ae..f954ec1 100644
--- a/sdks/python/apache_beam/examples/complete/autocomplete.py
+++ b/sdks/python/apache_beam/examples/complete/autocomplete.py
@@ -78,7 +78,8 @@ class TopPerPrefix(beam.PTransform):
             | beam.combiners.Top.LargestPerKey(self._count))
 
 
-def extract_prefixes((word, count)):
+def extract_prefixes(element):
+  word, count = element
   for k in range(1, len(word) + 1):
     prefix = word[:k]
     yield prefix, (count, word)

http://git-wip-us.apache.org/repos/asf/beam/blob/d1ac3055/sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py
----------------------------------------------------------------------
diff --git 
a/sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py 
b/sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py
index 8e5d5b3..5ff2b78 100644
--- a/sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py
+++ b/sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py
@@ -33,8 +33,9 @@ def from_pixel(x, y, n):
   return complex(2.0 * x / n - 1.0, 2.0 * y / n - 1.0)
 
 
-def get_julia_set_point_color((x, y), c, n, max_iterations):
+def get_julia_set_point_color(element, c, n, max_iterations):
   """Given an pixel, convert it into a point in our julia set."""
+  x, y = element
   z = from_pixel(x, y, n)
   for i in xrange(max_iterations):
     if z.real * z.real + z.imag * z.imag > 2.0:

http://git-wip-us.apache.org/repos/asf/beam/blob/d1ac3055/sdks/python/apache_beam/io/textio.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/io/textio.py 
b/sdks/python/apache_beam/io/textio.py
index 2ddaf02..19980cb 100644
--- a/sdks/python/apache_beam/io/textio.py
+++ b/sdks/python/apache_beam/io/textio.py
@@ -333,7 +333,7 @@ class ReadFromText(PTransform):
   """A PTransform for reading text files.
 
   Parses a text file as newline-delimited elements, by default assuming
-  UTF-8 encoding. Supports newline delimiters '\n' and '\r\n'.
+  UTF-8 encoding. Supports newline delimiters '\\n' and '\\r\\n'.
 
   This implementation only supports reading text encoded using UTF-8 or ASCII.
   This does not support other encodings such as UTF-16 or UTF-32.
@@ -352,22 +352,21 @@ class ReadFromText(PTransform):
 
     Args:
       file_pattern: The file path to read from as a local file path or a GCS
-        gs:// path. The path can contain glob characters (*, ?, and [...]
-        sets).
+        ``gs://`` path. The path can contain glob characters
+        ``(*, ?, and [...] sets)``.
       min_bundle_size: Minimum size of bundles that should be generated when
-                       splitting this source into bundles. See
-                       ``FileBasedSource`` for more details.
+        splitting this source into bundles. See ``FileBasedSource`` for more
+        details.
       compression_type: Used to handle compressed input files. Typical value
-          is CompressionTypes.AUTO, in which case the underlying file_path's
-          extension will be used to detect the compression.
+        is CompressionTypes.AUTO, in which case the underlying file_path's
+        extension will be used to detect the compression.
       strip_trailing_newlines: Indicates whether this source should remove
-                               the newline char in each line it reads before
-                               decoding that line.
+        the newline char in each line it reads before decoding that line.
       validate: flag to verify that the files exist during the pipeline
-                creation time.
+        creation time.
       skip_header_lines: Number of header lines to skip. Same number is skipped
-                         from each source file. Must be 0 or higher. Large
-                         number of skipped lines might impact performance.
+        from each source file. Must be 0 or higher. Large number of skipped
+        lines might impact performance.
       coder: Coder used to decode each line.
     """
 

http://git-wip-us.apache.org/repos/asf/beam/blob/d1ac3055/sdks/python/generate_pydoc.sh
----------------------------------------------------------------------
diff --git a/sdks/python/generate_pydoc.sh b/sdks/python/generate_pydoc.sh
index d680f30..d69b8a7 100755
--- a/sdks/python/generate_pydoc.sh
+++ b/sdks/python/generate_pydoc.sh
@@ -32,7 +32,8 @@ mkdir -p target/docs/source
 excluded_internal_clients=(
     apache_beam/internal/clients/
     apache_beam/io/google_cloud_platform/internal/clients/
-    apache_beam/runners/google_cloud_dataflow/internal/clients/)
+    apache_beam/runners/google_cloud_dataflow/internal/clients/
+    apache_beam/examples/complete/juliaset/setup.py)
 python $(type -p sphinx-apidoc) -f -o target/docs/source apache_beam \
     "${excluded_internal_clients[@]}"
 
@@ -61,12 +62,15 @@ cat > target/docs/source/index.rst <<'EOF'
 EOF
 
 # Build the documentation using sphinx
-python $(type -p sphinx-build) -q target/docs/source target/docs/_build -c 
target/docs/source \
-    -w "target/docs/sphinx-build.warnings.log"
+# Reference: http://www.sphinx-doc.org/en/stable/man/sphinx-build.html
+python $(type -p sphinx-build) -v -a -E -q target/docs/source \
+  target/docs/_build -c target/docs/source \
+  -w "target/docs/sphinx-build.warnings.log"
 
 # Message is useful only when this script is run locally.  In a remote
 # test environment, this path will be removed when the test completes.
 echo "Browse to file://$PWD/target/docs/_build/index.html"
 
-# Fail if there are errors in docs
+# Fail if there are errors or warnings in docs
 ! grep -q "ERROR:" target/docs/sphinx-build.warnings.log
+! grep -q "WARNING:" target/docs/sphinx-build.warnings.log

Reply via email to