I’m running running Python 3.9.18, great_expectations, version 0.18.8
I’m trying to use https://greatexpectations.io/expectations/expect_column_pair_values_to_be_in_set
How can the value_pairs_set inputs be specified via a json expectations file?
The sample code of
[('apple','red'),('apple','green'),('apple','yellow'), ('banana','yellow')]
when I saved as json via json.dumps I get
[["apple", "red"], ["apple", "green"], ["apple", "yellow"], ["banana", "yellow"]]
and plug into json as follows
{
"expectation_type": "expect_column_pair_values_to_be_in_set",
"kwargs": {
"column_A": "mycolA",
"column_B": "mycolB",
"value_pairs_set": [["apple", "red"], ["apple", "green"], ["apple", "yellow"], ["banana", "yellow"]]
}
},
However when I run the validation I get an error in ge_validations_store
"exception_message": "Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).",
"exception_traceback": "Traceback (most recent call last):\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/great_expectations/execution_engine/execution_engine.py\", line 548, in _process_direct_and_bundled_metric_computation_configurations\n ] = metric_computation_configuration.metric_fn( # type: ignore[misc] # F not callable\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/great_expectations/expectations/metrics/map_metric_provider/map_condition_auxilliary_methods.py\", line 128, in _pandas_map_condition_index\n domain_records_df = domain_records_df[boolean_mapped_unexpected_values]\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/pandas/core/frame.py\", line 3884, in __getitem__\n return self._getitem_bool_array(key)\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/pandas/core/frame.py\", line 3940, in _getitem_bool_array\n key = check_bool_indexer(self.index, key)\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/pandas/core/indexing.py\", line 2575, in check_bool_indexer\n raise IndexingError(\npandas.errors.IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/great_expectations/validator/validation_graph.py\", line 285, in _resolve\n self._execution_engine.resolve_metrics(\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/great_expectations/execution_engine/execution_engine.py\", line 283, in resolve_metrics\n return self._process_direct_and_bundled_metric_computation_configurations(\n File \"/opt/anaconda3/envs/data-eng-tools-py/lib/python3.9/site-packages/great_expectations/execution_engine/execution_engine.py\", line 552, in _process_direct_and_bundled_metric_computation_configurations\n raise gx_exceptions.MetricResolutionError(\ngreat_expectations.exceptions.exceptions.MetricResolutionError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).\n",
Any help much appeciated!