nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: great-expectations/great_expectations
Pull request #7018 (2023-02-01 10:05:49)

[CONTRIB] Adding support for punctuation in column_value for the row_condition parser
Hello great reviewers,

Changes proposed in this pull request:
- Adding support for punctuation in column_value for the row_condition parser


### Definition of Done
Please delete options that are not relevant.

- [ V] My code follows the Great Expectations [style guide](https://docs.greatexpectations.io/docs/contributing/style_guides/code_style)
- [V ] I have performed a [self-review](https://docs.greatexpectations.io/docs/contributing/contributing_checklist) of my own code
- [ V] I have added [unit tests](https://docs.greatexpectations.io/docs/contributing/contributing_test#writing-unit-and-integration-tests) where applicable and made sure that new and existing tests are passing.



netlify[bot]: ### <span aria-hidden="true">👷</span> Deploy request for *niobium-lead-7998* pending review.
[Visit the deploys page to approve it](https://app.netlify.com/sites/niobium-lead-7998/deploys)

|  Name | Link |
|---------------------------------|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 67a469dd1eeac0fc5505d161f7cde835db80447b |

Patch:
diff --git a/great_expectations/expectations/row_conditions.py b/great_expectations/expectations/row_conditions.py
index d41b47cef..91a2dcdd7 100644
--- a/great_expectations/expectations/row_conditions.py
+++ b/great_expectations/expectations/row_conditions.py
@@ -2,6 +2,7 @@ from __future__ import annotations
 
 import enum
 from dataclasses import dataclass
+from string import punctuation
 from typing import TYPE_CHECKING
 
 from pyparsing import (
@@ -51,9 +52,11 @@ le = Literal("<=")
 eq = Literal("==")
 ops = (gt ^ lt ^ ge ^ le ^ eq).setResultsName("op")
 fnumber = Regex(r"[+-]?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?").setResultsName("fnumber")
-condition_value = Suppress('"') + Word(f"{alphanums}._").setResultsName(
+punctuation_without_apostrophe = punctuation.replace('"', "").replace("'", "")
+condition_value_chars = alphanums + punctuation_without_apostrophe
+condition_value = Suppress('"') + Word(f"{condition_value_chars}._").setResultsName(
     "condition_value"
-) + Suppress('"') ^ Suppress("'") + Word(f"{alphanums}._").setResultsName(
+) + Suppress('"') ^ Suppress("'") + Word(f"{condition_value_chars}._").setResultsName(
     "condition_value"
 ) + Suppress(
     "'"


Test patch:
diff --git a/tests/expectations/test_row_conditions.py b/tests/expectations/test_row_conditions.py
index 347801b16..d1d926ceb 100644
--- a/tests/expectations/test_row_conditions.py
+++ b/tests/expectations/test_row_conditions.py
@@ -41,3 +41,6 @@ def test_parse_condition_to_sqlalchemy(sa):
 
     res = parse_condition_to_sqlalchemy('col("foo").notNull()')
     assert str(res) == "foo IS NOT NULL"
+
+    res = parse_condition_to_sqlalchemy('col("foo") == "a-b"')
+    assert str(res) == "foo = :foo_1"