This is an automated email from the ASF dual-hosted git repository.
dianfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 52f5eaa0b25 [FLINK-38812][python] Add log to show whether cython is
enabled (#27458)
52f5eaa0b25 is described below
commit 52f5eaa0b25c02e3a02b02223af1484761e21b7a
Author: Liu Jiangang <[email protected]>
AuthorDate: Wed Jan 28 15:48:45 2026 +0800
[FLINK-38812][python] Add log to show whether cython is enabled (#27458)
---
flink-python/pyflink/fn_execution/__init__.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/flink-python/pyflink/fn_execution/__init__.py
b/flink-python/pyflink/fn_execution/__init__.py
index 5fe372ac04e..bd8211dd338 100644
--- a/flink-python/pyflink/fn_execution/__init__.py
+++ b/flink-python/pyflink/fn_execution/__init__.py
@@ -16,10 +16,15 @@
# limitations under the License.
################################################################################
+import logging
import os
+_LOG = logging.getLogger(__name__)
+
if 'PYFLINK_CYTHON_ENABLED' in os.environ:
PYFLINK_CYTHON_ENABLED = bool(os.environ['PYFLINK_CYTHON_ENABLED'])
+ if not PYFLINK_CYTHON_ENABLED:
+ _LOG.info("PYFLINK_CYTHON_ENABLED is set to False via environment
variable.")
else:
PYFLINK_CYTHON_ENABLED = True
@@ -31,8 +36,10 @@ else:
# Check whether beam could be fast and force PyFlink to be slow if beam is slow
try:
from apache_beam.coders import stream # noqa # pylint:
disable=unused-import
-except:
+except Exception as e:
PYFLINK_CYTHON_ENABLED = False
+ _LOG.info("PYFLINK_CYTHON_ENABLED is set to False because of "
+ "apache_beam.coders.stream import error: %s", str(e))
# Check whether PyFlink could be fast
@@ -44,5 +51,9 @@ try:
# noqa # pylint: disable=unused-import
from pyflink.fn_execution.table import window_aggregate_fast,
aggregate_fast \
# noqa # pylint: disable=unused-import
-except:
+except Exception as e:
PYFLINK_CYTHON_ENABLED = False
+ _LOG.info("PYFLINK_CYTHON_ENABLED is set to False because of "
+ "pyflink cython extensions import error: %s", str(e))
+
+_LOG.info("PYFLINK_CYTHON_ENABLED: %s", PYFLINK_CYTHON_ENABLED)