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

   ## What is the purpose of the change
   
   This pull request adds missing-value handling methods to the PyFlink 
DataFrame API, enabling users to easily drop or fill NULL and NaN values in 
their data processing pipelines.
   
   ## Brief change log
   
   - Added `drop_null()` method to remove rows containing NULL values
   - Added `drop_nan()` method to remove rows containing NaN values  
   - Added `fill_null()` method to replace NULL values with specified values
   - Added `fill_nan()` method to replace NaN values with specified values
   - Implemented `IS_NAN` and `IS_NOT_NAN` built-in functions in Flink Table 
API (required infrastructure for NaN detection)
   - Added `is_nan` and `is_not_nan` helper functions to Expression API 
(mirrors `is_null`/`is_not_null` pattern)
   - Added helper methods `_validate_subset()` and `_fill_values()` for DRY 
code organization
   - Added comprehensive unit and integration tests for all new methods
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Added unit tests (`DataFrameDropNullTests`, `DataFrameDropNanTests`, 
`DataFrameFillNullTests`, `DataFrameFillNanTests`) that verify:
     - Schema preservation for all operations
     - Parameter validation with comprehensive error case coverage:
       - Empty subset lists raise `ValueError`
       - Invalid column names raise `ValueError` with clear error messages
       - Non-list subset parameters raise `TypeError`
   - Added integration tests (`DataFrameNullNanITTests`) that verify correct 
behavior with real data:
     - `drop_null()` correctly removes rows with NULL values
     - `drop_nan()` correctly removes rows with NaN values
     - `fill_null()` correctly replaces NULL with specified values (numeric and 
string)
     - `fill_nan()` correctly replaces NaN with specified values
     - All methods work correctly with `subset` parameter to target specific 
columns
   - Tests cover success cases, error conditions, and different data types
   
   ## 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)`: yes (new `@PublicEvolving` DataFrame methods)
     - 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, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented? JavaDocs (comprehensive Python 
docstrings with examples and version tags)
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Bob Shell 1.0.6
   


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