wilmerdooley opened a new pull request, #28491:
URL: https://github.com/apache/flink/pull/28491

   ## What is the purpose of this PR
   
   When using `StreamExecutionEnvironment.from_source` in PyFlink with a 
`WatermarkStrategy` that includes a custom Python `TimestampAssigner`, the 
assigner was never invoked. The watermark strategy was passed through to the 
Java source operator, which executes the assigner on the JVM side and therefore 
ignores the Python implementation entirely.
   
   This change detects whether the supplied `WatermarkStrategy` carries a 
Python timestamp assigner. If so, it creates the source without watermarks and 
applies the watermark strategy downstream via 
`DataStream.assign_timestamps_and_watermarks`, so the Python 
`TimestampAssigner` is actually executed.
   
   The fix is implemented in 
`flink-python/pyflink/datastream/stream_execution_environment.py`, and a 
regression test has been added in 
`flink-python/pyflink/datastream/tests/test_stream_execution_environment.py` 
that uses `NumberSequenceSource` together with a custom `TimestampAssigner` and 
a `ProcessFunction` to verify the extracted timestamps.
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   - [x] No
   
   JIRA: https://issues.apache.org/jira/browse/FLINK-39725
   
   Generated-by: Claude Code


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to