diff --git a/.github/workflows/downstreams.yml b/.github/workflows/downstreams.yml deleted file mode 100644 index 87bf06f41..000000000 --- a/.github/workflows/downstreams.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: downstreams - -on: - pull_request: - types: [opened, synchronize] - merge_group: - types: [checks_requested] - push: - # Always run on push to main. The build cache can only be reused - # if it was saved by a run from the repository's default branch. - # The run result will be identical to that from the merge queue - # because the commit is identical, yet we need to perform it to - # seed the build cache. - branches: - - main - -permissions: - id-token: write - contents: read - pull-requests: write - -jobs: - compatibility: - strategy: - fail-fast: false - matrix: - downstream: - #- name: ucx - - name: remorph - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - with: - fetch-depth: 0 - - - name: Install Python - uses: actions/setup-python@v5 - with: - cache: 'pip' - cache-dependency-path: '**/pyproject.toml' - python-version: '3.12' - - - name: Install toolchain - run: | - pip install hatch==1.15.0 - - - name: Check downstream compatibility - uses: databrickslabs/sandbox/downstreams@downstreams/v0.0.1 - with: - repo: ${{ matrix.downstream.name }} - org: databrickslabs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/databricks/labs/dqx/utils.py b/src/databricks/labs/dqx/utils.py index e435cf85a..39d8bb2d0 100644 --- a/src/databricks/labs/dqx/utils.py +++ b/src/databricks/labs/dqx/utils.py @@ -25,7 +25,7 @@ COLUMN_NORMALIZE_EXPRESSION = re.compile("[^a-zA-Z0-9]+") -COLUMN_PATTERN = re.compile(r"Column<'(.*?)(?: AS (\w+))?'>$") +COLUMN_PATTERN = re.compile(r"Column<'(.*?)(?: AS (\w+))?'>$", re.DOTALL) INVALID_COLUMN_NAME_PATTERN = re.compile(r"[\s,;{}\(\)\n\t=]+") diff --git a/tests/integration/test_apply_checks.py b/tests/integration/test_apply_checks.py index 054615bab..4a2c5f968 100755 --- a/tests/integration/test_apply_checks.py +++ b/tests/integration/test_apply_checks.py @@ -4542,6 +4542,18 @@ def test_apply_checks_with_sql_expression(ws, spark): "criticality": "error", "check": {"function": "sql_expression", "arguments": {"expression": "col1 not like \"val%\""}}, }, + { + "criticality": "error", + "check": { + "function": "sql_expression", + "arguments": { + # expression with new line + "expression": """col2 +not + like \"val%\"""" + }, + }, + }, { "criticality": "error", "check": { @@ -4580,6 +4592,16 @@ def test_apply_checks_with_sql_expression(ws, spark): "run_id": RUN_ID, "user_metadata": {}, }, + { + "name": "not_col2_not_like_val", + "message": "Value is not matching expression: col2 \nnot \n like \"val%\"", + "columns": None, + "filter": None, + "function": "sql_expression", + "run_time": RUN_TIME, + "run_id": RUN_ID, + "user_metadata": {}, + }, { "name": "not_col2_not_like_val", "message": "Value is not matching expression: col2 not like 'val%'",