Skip to content

Commit

Permalink
[BUGFIX] Patch broken include_rendered_content test in advance of `…
Browse files Browse the repository at this point in the history
…0.16.8` release (#7663)
  • Loading branch information
cdkini committed Apr 20, 2023
1 parent 31b55bb commit 5be30b7
Showing 1 changed file with 20 additions and 7 deletions.
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

0 comments on commit 5be30b7

Please sign in to comment.