Skip to content

ExpectColumnDistinctValuesToBeInSet result.observed_value always return None. #11913

@rsbarhey

Description

@rsbarhey

Describe the bug
result.observed_value should return the values observed from the value_set. Instead it always return None

To Reproduce

import great_expectations as gx
import pandas as pd
df = pd.DataFrame({"test": ["Yes", "No"]})
data_source_name = "my_pandas_data_source"
data_asset_name = "my_dataframe_data_asset"
data_context = gx.get_context()
data_source = data_context.data_sources.add_pandas(name=data_source_name)
data_asset = data_source.add_dataframe_asset(name=data_asset_name)
batch_definition_name = "my_batch_definition"
batch_definition = data_asset.add_batch_definition_whole_dataframe(batch_definition_name)
batch_parameters = {"dataframe":df}
batch = batch_definition.get_batch(batch_parameters)
expectations = gx.expectations.core.expect_column_distinct_values_to_be_in_set.ExpectColumnDistinctValuesToBeInSet(column="test", value_set=["Yes","No"])
result = batch.validate(expectations).result
print(result)

Expected behavior
observed_value should return ["Yes","No"] as these were observed in the test dataframe as documented here https://greatexpectations.io/expectations/expect_column_distinct_values_to_be_in_set/
Environment (please complete the following information):

  • Operating System: Windows
  • Great Expectations Version: 1.18.1
  • Data Source: Pandas
  • Cloud environment: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions