great-expectations / great_expectations

Always know what to expect from your data.
https://docs.greatexpectations.io/
Apache License 2.0
9.71k stars 1.5k forks source link

No provider found for method using SqlAlchemyExecutionEngine for json-related expectations #9291

Open leeroyaus opened 6 months ago

leeroyaus commented 6 months ago

Describe the bug Using json-related expectations expect_column_values_to_match_json_schema and expect_column_values_to_be_json_parseable

To Reproduce

Code to reproduce (raw_data col contains json data as text):

{
      "expectation_type": "expect_column_values_to_be_json_parseable",
      "kwargs": {
        "column": "raw_data"
      },
      "meta": {
        "notes": {
          "content": "Check that column is json parseable",
          "format": "markdown"
        }
      }
    }

Full stack traceback below:

No provider found for column_values.json_parseable.unexpected_count using SqlAlchemyExecutionEngine
Show exception traceback...

Traceback (most recent call last):
File "/workspace/pisa2025-api-etl/.venv/lib/python3.10/site-packages/great_expectations/expectations/registry.py", line 304, in get_metric_provider
return metric_definition["providers"][type(execution_engine).__name__]
KeyError: 'SqlAlchemyExecutionEngine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/workspace/pisa2025-api-etl/.venv/lib/python3.10/site-packages/great_expectations/validator/validator.py", line 1143, in _generate_metric_dependency_subgraphs_for_each_expectation_configuration
graph=self._metrics_calculator.build_metric_dependency_graph(
File "/workspace/pisa2025-api-etl/.venv/lib/python3.10/site-packages/great_expectations/validator/metrics_calculator.py", line 208, in build_metric_dependency_graph
graph.build_metric_dependency_graph(
File "/workspace/pisa2025-api-etl/.venv/lib/python3.10/site-packages/great_expectations/validator/validation_graph.py", line 130, in build_metric_dependency_graph
) = self.set_metric_configuration_default_kwargs_if_absent(
File "/workspace/pisa2025-api-etl/.venv/lib/python3.10/site-packages/great_expectations/validator/validation_graph.py", line 174, in set_metric_configuration_default_kwargs_if_absent
metric_impl_klass, metric_provider = get_metric_provider(
File "/workspace/pisa2025-api-etl/.venv/lib/python3.10/site-packages/great_expectations/expectations/registry.py", line 306, in get_metric_provider
raise gx_exceptions.MetricProviderError(
great_expectations.exceptions.exceptions.MetricProviderError: No provider found for column_values.json_parseable.unexpected_count using SqlAlchemyExecutionEngine

Expected behavior Expectations to run without error

Environment (please complete the following information):

Additional context Seems to be an issue parsing any JSON data, so not sure if it's related to my set up (but please let me know if you need more information)

Kilo59 commented 5 months ago

@leeroyaus is sqlalchemy installed? By default, we don't require it when great_expectations is installed.