Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Patch broken include_rendered_content test in advance of 0.16.8 release #7663

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import random
import string
from unittest import mock

import pandas as pd
Expand Down Expand Up @@ -106,21 +108,32 @@ def test_cloud_backed_data_context_expectation_validation_result_include_rendere
context = empty_cloud_data_context

df = pd.DataFrame([1, 2, 3, 4, 5])

data_asset = context.sources.pandas_default.add_dataframe_asset(
name="my_dataframe_asset",
dataframe=df,
)
suite_name = f"test_suite_{''.join(random.choice(string.ascii_letters + string.digits) for _ in range(8))}"
mock_datasource_get_response = {
"data": {
"id": "123456",
"attributes": {
"datasource_config": {},
},
},
}

with mock.patch(
"great_expectations.data_context.store.gx_cloud_store_backend.GXCloudStoreBackend.has_key",
return_value=False,
), mock.patch(
"great_expectations.data_context.store.gx_cloud_store_backend.GXCloudStoreBackend._set"
"great_expectations.data_context.store.gx_cloud_store_backend.GXCloudStoreBackend.set"
), mock.patch(
"great_expectations.data_context.store.gx_cloud_store_backend.GXCloudStoreBackend.get",
return_value=mock_datasource_get_response,
):
data_asset = context.sources.pandas_default.add_dataframe_asset(
name="my_dataframe_asset",
dataframe=df,
)
validator: Validator = context.get_validator(
batch_request=data_asset.build_batch_request(),
create_expectation_suite_with_name="test_suite",
create_expectation_suite_with_name=suite_name,
)

expectation_validation_result: ExpectationValidationResult = (
Expand Down