Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-18927][python][doc] Add Debugging document in Python Table API #13171

Closed
wants to merge 3 commits into from

Conversation

HuangXingBo
Copy link
Contributor

What is the purpose of the change

This pull request will add Debugging doc in Python Table API

Brief change log

  • Add debugging.md and debugging.zh.md

Verifying this change

execute the script build_docs.sh

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, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

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

@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.

Automated Checks

Last check on commit 9474e60 (Mon Aug 17 09:33:40 UTC 2020)

✅no warnings

Mention the bot in a comment to re-run the automated checks.

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.


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

@flinkbot
Copy link
Collaborator

flinkbot commented Aug 17, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@sjwiesman sjwiesman left a comment

Choose a reason for hiding this comment

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

Made some engilish grammar suggestions.

Comment on lines 32 to 33
You can take use of Logging module of Python to print infos in Python UDF. e.g.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can take use of Logging module of Python to print infos in Python UDF. e.g.
Python UDFs can log contextual and debug information via standard Python logging modules.

Comment on lines 48 to 50
If you set the environment variable `FLINK_HOME`, logs will be placed in the log directory under `FLINK_HOME`.
Otherwise, logs will be placed in the directory of PyFlink module. You can execute following command to find
the log directory of PyFlink module:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you set the environment variable `FLINK_HOME`, logs will be placed in the log directory under `FLINK_HOME`.
Otherwise, logs will be placed in the directory of PyFlink module. You can execute following command to find
the log directory of PyFlink module:
If the environment variable `FLINK_HOME` is set, logs will be written in the log directory under `FLINK_HOME`.
Otherwise, logs will be placed in the directory of the PyFlink module. You can execute the following command to find
the log directory of PyFlink module:

@HuangXingBo
Copy link
Contributor Author

Thanks a lot for @sjwiesman review. I have addressed the comments at the latest commit.

Copy link
Contributor

@morsapaes morsapaes 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 adding debugging hints, @HuangXingBo, this is really useful! Left some minor suggestions/corrections.


If the environment variable `FLINK_HOME` is set, logs will be written in the log directory under `FLINK_HOME`.
Otherwise, logs will be placed in the directory of the PyFlink module. You can execute the following command to find
the log directory of PyFlink module:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the log directory of PyFlink module:
the log directory of the PyFlink module:


{% endhighlight %}

## Debug Python UDF
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Debug Python UDF
## Debugging Python UDFs

{% endhighlight %}

## Debug Python UDF
You can take use of the pydevd_pycharm tool of PyCharm to debug Python UDF.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can take use of the pydevd_pycharm tool of PyCharm to debug Python UDF.
You can make use of the [`pydevd_pycharm`](https://pypi.org/project/pydevd-pycharm/) tool of PyCharm to debug Python UDFs.


run -> Python Remote Debug -> + -> choose a port (e.g. 6789)

2. Install pydevd-pycharm tool
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. Install pydevd-pycharm tool
2. Install the `pydevd-pycharm` tool

pydevd_pycharm.settrace('localhost', port=6789, stdoutToServer=True, stderrToServer=True)
```

4. Start the previous created Python Remote Debug Server
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
4. Start the previous created Python Remote Debug Server
4. Start the previously created Python Remote Debug Server


{% endhighlight %}

## Watching Logs
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Watching Logs
## Accessing Logs

@HuangXingBo
Copy link
Contributor Author

HuangXingBo commented Aug 27, 2020

@morsapaes Thanks a lot for your review, I have addressed the comments at the latest fix-comments-2 commit

@HuangXingBo
Copy link
Contributor Author

@sjwiesman It would be great if you could take a look at the latest PR. Thanks a lot~

sjwiesman pushed a commit to sjwiesman/flink that referenced this pull request Nov 3, 2020
@sjwiesman
Copy link
Contributor

Merging

@sjwiesman sjwiesman closed this Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants