|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
| 15 | +import re |
| 16 | + |
15 | 17 | from absl.testing import absltest |
16 | 18 | from absl.testing import parameterized |
17 | 19 | from arolla import arolla |
@@ -109,32 +111,39 @@ def test_qtype_signatures(self): |
109 | 111 | def test_raises_on_incompatible_schemas(self): |
110 | 112 | with self.assertRaisesRegex( |
111 | 113 | exceptions.KodaError, |
112 | | - r"""cannot find a common schema for provided schemas |
113 | | -
|
114 | | - the common schema\(s\) INT32: INT32 |
115 | | - the first conflicting schema [0-9a-f]{32}:0: SCHEMA\(\)""", |
| 114 | + re.escape( |
| 115 | + 'kd.comparison.equal: arguments `x` and `y` must contain values' |
| 116 | + ' castable to a common type, got SCHEMA() and INT32' |
| 117 | + ), |
116 | 118 | ): |
117 | 119 | expr_eval.eval(kde.comparison.full_equal(ENTITY_1, ds(1))) |
118 | 120 |
|
119 | 121 | db = data_bag.DataBag.empty() |
120 | 122 | with self.assertRaisesRegex( |
121 | 123 | exceptions.KodaError, |
122 | | - r"""cannot find a common schema for provided schemas |
123 | | -
|
124 | | - the common schema\(s\) [0-9a-f]{32}:0: SCHEMA\(x=INT32\) |
125 | | - the first conflicting schema [0-9a-f]{32}:0: SCHEMA\(\)""", |
| 124 | + re.escape( |
| 125 | + 'kd.comparison.equal: arguments `x` and `y` must contain values' |
| 126 | + ' castable to a common type, got SCHEMA(x=INT32) and SCHEMA()' |
| 127 | + ), |
126 | 128 | ): |
127 | 129 | expr_eval.eval(kde.comparison.full_equal(db.new(x=1), db.new())) |
128 | 130 |
|
129 | 131 | with self.assertRaisesRegex( |
130 | 132 | exceptions.KodaError, |
131 | | - 'cannot find a common schema for provided schemas', |
| 133 | + re.escape( |
| 134 | + 'kd.comparison.equal: arguments `x` and `y` must contain values' |
| 135 | + ' castable to a common type, got SCHEMA(x=INT32) and OBJECT with an' |
| 136 | + ' item of type ITEMID' |
| 137 | + ), |
132 | 138 | ): |
133 | 139 | expr_eval.eval(kde.comparison.full_equal(db.new(x=1), db.obj())) |
134 | 140 |
|
135 | 141 | with self.assertRaisesRegex( |
136 | 142 | exceptions.KodaError, |
137 | | - 'cannot find a common schema for provided schemas', |
| 143 | + re.escape( |
| 144 | + 'kd.comparison.equal: arguments `x` and `y` must contain values' |
| 145 | + ' castable to a common type, got SCHEMA(x=INT32) and ITEMID' |
| 146 | + ), |
138 | 147 | ): |
139 | 148 | expr_eval.eval( |
140 | 149 | kde.comparison.full_equal( |
|
0 commit comments