featzhang commented on PR #28140:
URL: https://github.com/apache/flink/pull/28140#issuecomment-4426197704
## CI Failure Analysis: Python Test Assertion Mismatch
The Azure CI pipeline failed due to a Python test assertion error in
`pyflink/table/tests/test_expression.py:198`.
### Root Cause
The function name change from `regexpExtract` to `REGEXP_EXTRACT` in
`BuiltInFunctionDefinitions.java` (Line 1390) caused the Python test to fail:
```python
# Test expects:
self.assertEqual('regexpExtract(a, b)', str(expr1.regexp_extract(expr2)))
# Actual output:
AssertionError: 'regexpExtract(a, b)' != 'REGEXP_EXTRACT(a, b)'
```
### Required Fix
Update the Python test file to match the new function name:
**File**: `flink-python/pyflink/table/tests/test_expression.py`
**Line**: ~L198
```python
# Change from:
self.assertEqual('regexpExtract(a, b)', str(expr1.regexp_extract(expr2)))
# To:
self.assertEqual('REGEXP_EXTRACT(a, b)', str(expr1.regexp_extract(expr2)))
```
**Note**: Please also check if there are assertions for the 3-parameter
version (with `extractIndex`) and update them accordingly:
```python
self.assertEqual('REGEXP_EXTRACT(a, b, 1)', str(expr1.regexp_extract(expr2,
1)))
```
### Rationale for Name Change
The change aligns with:
- SQL standard naming conventions (uppercase with underscores)
- Consistency with other regex functions (`REGEXP_COUNT`, `REGEXP_REPLACE`,
etc.)
- The function's SQL name, which has always been `REGEXP_EXTRACT`
The Python API method name (`regexp_extract()`) remains unchanged for
backward compatibility; only the underlying Java function name and its string
representation are affected.
### Build Link
[Azure Build
74992](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=74992)
- Failed at `Test - python` task
--
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]