hequn8128 commented on a change in pull request #9855: [FLINK-14306][python] 
Add the code-generated flink_fn_execution_pb2.py to the codebase
URL: https://github.com/apache/flink/pull/9855#discussion_r332800607
 
 

 ##########
 File path: flink-python/pyflink/gen_protos.py
 ##########
 @@ -39,20 +39,21 @@
     os.path.join('proto'),
 ]
 
-PYTHON_OUTPUT_PATH = os.path.join('fn_execution')
 
+PYFLINK_ROOT = os.path.dirname(os.path.abspath(__file__))
+DEFAULT_PYTHON_OUTPUT_PATH = os.path.join(PYFLINK_ROOT, 'fn_execution')
 
-def generate_proto_files(force=False):
+
+def generate_proto_files(force=True, output_dir=DEFAULT_PYTHON_OUTPUT_PATH):
     try:
         import grpc_tools  # noqa  # pylint: disable=unused-import
 
 Review comment:
   If we generate the file manually, it's better to also check the version of 
grpc_tools as we have version constraint for it, i.e., `GRPC_TOOLS = 
'grpcio-tools>=1.3.5,<=1.14.2'`.
   - Verify version in `generate_proto_files`.
   - Add the version requirement to the README.md of this module.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to