Hello Everyone,
We got an Issue while performing Validation on Postgres database with below expectation
expectation_with_condition2 = gx.expectations.ExpectColumnValuesToBeOfType(column="asset_type_id", type_="INTEGER")
Error
{
"success": false,
"expectation_config": {
"type": "expect_column_values_to_be_of_type",
"kwargs": {
"column": "asset_type_id",
"type_": "INTEGER",
"batch_id": "postgres_datasource-SFI_Table_Asset"
},
"meta": {}
},
"result": {},
"meta": {},
"exception_info": {
"exception_traceback": "Traceback (most recent call last):\n File \"C:\\Users\\vijaykuma_g\\Downloads\\Python_GX\\gp_new\\Lib\\site-packages\\great_expectations\\validator\\validator.py\", line 650, in graph_validate\n result = expectation.metrics_validate(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\vijaykuma_g\\Downloads\\Python_GX\\gp_new\\Lib\\site-packages\\great_expectations\\expectations\\expectation.py\", line 1150, in metrics_validate\n expectation_validation_result: Union[ExpectationValidationResult, dict] = self._validate(\n ^^^^^^^^^^^^^^^\n File \"C:\\Users\\vijaykuma_g\\Downloads\\Python_GX\\gp_new\\Lib\\site-packages\\great_expectations\\expectations\\core\\expect_column_values_to_be_of_type.py\", line 568, in _validate\n type_dict[\"type\"]\n ~~~~~~~~~^^^^^^^^\nKeyError: 'type'\n",
"exception_message": "'type'",
"raised_exception": true
}
}
This expectation works fine with Pandas, bur not in Postgres
It seems there was a problem while retrieving column types . can some one help me on this , this would be really helpful.
Thanks in advance
Vijay