-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GE can't parse a row condition in a conditional expectation #6408
Comments
Hi, expectation
Error:
Issue occurs when column name or the value to compare contains a space. If I try column name without a space (e.g. Could someone please help me with this issue? |
Hey @Vitalis-Tk & @zvpanchal ! Thanks for reaching out. I've been able to reproduce the behavior you're experiencing here, and will be discussing this functionality internally with the team in the coming week. |
Hi @austiezr - Is there any update on this issue? Using
Error that I get:
I am using great_expectations v0.15.43 (v3 API) |
Hi @zvpanchal and @Vitalis-Tk I wanted to provide an update that the Core Engineering team has picked up this issue. More updates to come very soon. Thank you for your patience and for your follow up :) |
|
@zvpanchal and @Vitalis-Tk the PR #7313 should address the issue you were having, and should be included in tomorrow's release :) |
Hi @Shinnnyshinshin - This issue still occurs when either column name or value contains space in it. Please refer to the issue I raised in discourse. Could anyone please help? |
Describe the bug
GE can't parse a row condition in a conditional expectation if there is a comparison between strings and the string in the condition contains a whitespace.
To Reproduce
First Case: (ExpectationConfiguration in json format)
{
"expectation_type": "expect_column_values_to_not_be_null",
"column": column_A,
"condition_parser": "great_expectations__experimental__",
"mostly": 1.0,
"row_condition": "col(\"communication_type_desc_orig\") == \"Email\""
}
Result: the expectation executes without any issues.
Second Case: (ExpectationConfiguration in json format)
{
"expectation_type": "expect_column_values_to_not_be_null",
"column": column_B,
"condition_parser": "great_expectations__experimental__",
"mostly": 1.0,
"row_condition": "col(\"communication_type_desc_orig\")==\"Secure Message\""
}
Result: The expectation fails to execute. Error: unable to parse condition: col("communication_type_desc_orig")=="Secure Message"
Stacktrace:
File "/usr/local/lib/python3.9/site-packages/great_expectations/expectations/row_conditions.py", line 111, in _parse_great_expectations_condition
return condition.parseString(row_condition)
File "/usr/local/lib/python3.9/site-packages/pyparsing/core.py", line 1141, in parse_string raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected {{Combine:({Suppress:('col(\\\"') W:(A-Za-z, .0-9A-Z_a-z) Suppress:('\\\")')}) '.NOTNULL()'} ^ {Combine:({Suppress:('col(\\\"') W:(A-Za-z, .0-9A-Z_a-z) Suppress:('\\\")')}) {'>' ^ '<' ^ '>=' ^ '<=' ^ '=='} {Re:('[+-]?\\\\d+(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?') ^ {Suppress:('\\\"') W:(.0-9A-Z_a-z) Suppress:('\\\"')} ^ {Suppress:(\\\"'\\\") W:(.0-9A-Z_a-z) Suppress:(\\\"'\\\")}}}}, found 'Message' (at char 45), (line:1, col:46)
Expected behavior
The expectation executes without any errors.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: