From a4c9ded8e5b9df0c4d84a7a9119015adf1a447c9 Mon Sep 17 00:00:00 2001 From: Brian Hulette Date: Tue, 14 Jun 2022 11:50:55 -0700 Subject: [PATCH] Remove dataframe warnings from py38-docs logs --- sdks/python/scripts/generate_pydoc.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sdks/python/scripts/generate_pydoc.sh b/sdks/python/scripts/generate_pydoc.sh index 3c4f7524f646..c7e1ccecbd8c 100755 --- a/sdks/python/scripts/generate_pydoc.sh +++ b/sdks/python/scripts/generate_pydoc.sh @@ -247,24 +247,28 @@ EOF # Build the documentation using sphinx # Reference: http://www.sphinx-doc.org/en/stable/man/sphinx-build.html +# Note we cut out warnings from apache_beam.dataframe, this package uses pandas +# documentation verbatim. 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" + |& grep -E -v 'apache_beam\.dataframe.*WARNING:' \ + |& tee "target/docs/sphinx-build.log" # Fail if there are errors or warnings in docs -! grep -q "ERROR:" target/docs/sphinx-build.warnings.log || exit 1 -(! grep -v 'apache_beam.dataframe' target/docs/sphinx-build.warnings.log | grep -q "WARNING:") || exit 1 +! grep -q "ERROR:" target/docs/sphinx-build.log || exit 1 +! grep -q "WARNING:" target/docs/sphinx-build.log || exit 1 # Run tests for code samples, these can be: # - Code blocks using '.. testsetup::', '.. testcode::' and '.. testoutput::' # - Interactive code starting with '>>>' python -msphinx -M doctest target/docs/source \ target/docs/_build -c target/docs/source \ - -w "target/docs/sphinx-doctest.warnings.log" + |& grep -E -v 'apache_beam\.dataframe.*WARNING:' \ + |& tee "target/docs/sphinx-doctest.log" # Fail if there are errors or warnings in docs -! grep -q "ERROR:" target/docs/sphinx-doctest.warnings.log || exit 1 -(! grep -v 'apache_beam.dataframe' target/docs/sphinx-doctest.warnings.log | grep -q "WARNING:") || exit 1 +! grep -q "ERROR:" target/docs/sphinx-doctest.log || exit 1 +! grep -q "WARNING:" target/docs/sphinx-doctest.log || exit 1 # Message is useful only when this script is run locally. In a remote # test environment, this path will be removed when the test completes.