Skip to content

Conversation

@HuangXingBo
Copy link
Contributor

What is the purpose of the change

As the Python Table API is added, we should add the Python Table API Sphinx docs. This includes the following work:
Add scripts to build the Sphinx docs

Brief change log

  • Support Sphinx to create Flink Python Docs
  • Correct doc code style of Python code

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (docs)

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

Copy link
Contributor

@dianfu dianfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HuangXingBo Thanks a lot for the PR. Great work! I have left a few minor comments. Besides, the following issue should also be addressed: Some target of the Makefile will fail when executed such as make doctest, make pdf, etc.


:class:`pyflink.table.TableEnvironment`

Main entry point for Flink functionality.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Main entry point for Flink Table functionality.

:maxdepth: 1

pyflink.table

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the following text here to indicate that the following classes are the content of package pyflink:

Suggested change
Contents
--------

.. automodule:: pyflink.table
:members:
:undoc-members:
:show-inheritance:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One empty line at the end of the file

Copy link
Member

@sunjincheng121 sunjincheng121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @HuangXingBo! Great Job!
I one left one comment, and a suggestion is we should copy the python doc to docs content folder, and I am not sure, but I guess that the Apache CI will auto ren the Travis, and copy the content to https://ci.apache.org/projects/flink/flink-docs-master. And we also should add the link for Python Docs, just like: https://ci.apache.org/projects/flink/flink-docs-master/api/java/. for the Python Docs, maybe `https://ci.apache.org/projects/flink/flink-docs-master/api/python. So, we may need to add a plugin for Jekyll.
What do you think?

author = u'Author'

# The short X.Y version
version = '1.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunjincheng121 sunjincheng121 self-assigned this Jun 14, 2019
@sunjincheng121
Copy link
Member

sunjincheng121 commented Jun 14, 2019

I check it again, I found that Java and Scala Doc are built by BuilderBot(https://ci.apache.org/projects/flink/), The BuilderBot need a config flink.conf, and this config pleased svn repo. So we can do the copy logic change in a new PR. :) I have file the JIRA FLINK-12849. @HuangXingBo

@HuangXingBo
Copy link
Contributor Author

Thanks a lot for @dianfu @sunjincheng121.

  1. I add logic about sphinx installed and check in lint-python.sh.
  2. I add a generate-docs.sh responsible for call the script lint-python.sh to generate python api docs and copy the api docs to the specified target path.

Copy link
Contributor

@dianfu dianfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HuangXingBo Thanks a lot for the update. Mostly LGTM. Just left a few comments regarding to the newly added script generate-docs.sh.

@@ -0,0 +1,53 @@
::###############################################################################
:: Licensed to the Apache Software Foundation (ASF) under one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this script still does not work? We can remove it for now if the windows support is not ready.

echo "Copy python api docs to $TARGET_PATH failed."
exit 1
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one empty line at the end of file is enough

_BUILD_PATH="./_build"

if [[ ! -d "$_BUILD_PATH" ]]; then
echo "The directory $_BUILD_PATH is not created.you can retry to this script"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. empty space before the word you
  2. retry to -> retry to execute


_HTML_PATH="${_BUILD_PATH}/html"
if [[ ! -d "$_HTML_PATH" ]]; then
echo "The directory $_HTML_PATH is not created.you can retry to this script"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. empty space before the word you
  2. retry to -> retry to execute

fi

if [[ ! -d "$TARGET_PATH" ]]; then
echo "The supported dir is not exist."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specified directory does not exist.

USAGE="
usage: $0 [options]
-h print this help message and exit
-t list all checks supported.
Copy link
Contributor

@dianfu dianfu Jun 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description for option -t seems not correct.

esac
done

LINTPYTHON_PATH="../dev/lint-python.sh"
Copy link
Contributor

@dianfu dianfu Jun 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The means that we must execute this script under directory doc.
What about changed as follows:
FLINK_PYTHON_DOCS_DIR="$(cd "$( dirname "$0" )" && pwd)"
LINTPYTHON_PATH="$FLINK_PYTHON_DOCS_DIR/../dev/lint-python.sh"

@sunjincheng121
Copy link
Member

@dianfu Thanks for helping improve the PR! @HuangXingBo told me he is on the vacation cannot update the PR those days, he also agrees that if you want to help him, you can open a new PR with @HuangXingBo 's commit as a basic commit. What do you think?

@dianfu
Copy link
Contributor

dianfu commented Jun 18, 2019

@sunjincheng121 Thanks a lot for the suggestion. Makes sense to me and I have created PR #8774 based on @HuangXingBo 's great work.

@sunjincheng121
Copy link
Member

Thanks for your effort @HuangXingBo! and Thanks for open the new PR @dianfu!
I close this PR and review the new one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants