[
https://issues.apache.org/jira/browse/FLINK-20218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17235109#comment-17235109
]
Huang Xingbo commented on FLINK-20218:
--------------------------------------
The reason for the problem through investigation is:
1. apache-beam's `dataflow_runner.py` use `urllib.parse` before importing
`urllib.parse`.
https://github.com/apache/beam/blob/master/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
2. There was no problem before, because apache-beam will import google's
`protobuf` package at the beginning, and the protobuf package will import
`urllib.parse`, but this behavior has been removed in the newly released
`protobuf` version `3.14.0`, so indirectly caused The mistake on our side.
https://github.com/protocolbuffers/protobuf/commit/66e3562aafce093d30473555248f22b3fdc88aad#diff-e0c1278207c48e008bf5970ca223d400e2df9d0cdc648af58efeedd10bcdae5e
3. The cleanest way is to modify its incorrect use in the beam community. The
current appropriate approach on the pyflink side is that we import
`urllib.parse` before import beam to bypass the error behavior of beam.
> AttributeError: module 'urllib' has no attribute 'parse'
> --------------------------------------------------------
>
> Key: FLINK-20218
> URL: https://issues.apache.org/jira/browse/FLINK-20218
> Project: Flink
> Issue Type: Bug
> Components: API / Python
> Affects Versions: 1.10.3
> Reporter: Huang Xingbo
> Priority: Major
> Fix For: 1.10.3
>
>
> When executing python udf related examples, it will throw the following
> exception in constructing python environment:
> {code:java}
> AttributeError: module 'urllib' has no attribute 'parse'{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)