-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[MAINTENANCE] Misc cleanup of GX Cloud helpers #6352
Conversation
✅ Deploy Preview for niobium-lead-7998 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
👇 Click on the image for a new way to code review
Legend |
Contract
and SuiteValidationResult
from GeCloudRESTResource
enum…_expectations into m/_/clean_up_cloud_rest_resource_enum
# Delete local env vars (if present) | ||
for env_var in GXCloudEnvironmentVariable: | ||
monkeypatch.delenv(env_var, raising=False) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test fails if you have env vars set - let's ensure we clear out our environment for consistent behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like something we might want to re-use in a fixture.
clean_cloud_env_vars
/ no_cloud_env
🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup this was done shortly after!
class GXCloudEnvironmentVariable(str, Enum): | ||
BASE_URL = "GE_CLOUD_BASE_URL" | ||
ORGANIZATION_ID = "GE_CLOUD_ORGANIZATION_ID" | ||
ACCESS_TOKEN = "GE_CLOUD_ACCESS_TOKEN" | ||
|
||
|
||
class GeCloudRESTResource(str, Enum): | ||
class GXCloudRESTResource(str, Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes here are from these renames to GX
# Chetan - 20220811 - CONTRACT is deprecated by GX Cloud and is to be removed upon migration of E2E tests | ||
GeCloudRESTResource.CONTRACT: "checkpoint_config", | ||
GeCloudRESTResource.DATASOURCE: "datasource_config", | ||
GeCloudRESTResource.DATA_CONTEXT: "data_context_config", | ||
GeCloudRESTResource.DATA_CONTEXT_VARIABLES: "data_context_variables", | ||
GeCloudRESTResource.EXPECTATION_SUITE: "suite", | ||
GeCloudRESTResource.EXPECTATION_VALIDATION_RESULT: "result", | ||
GeCloudRESTResource.PROFILER: "profiler", | ||
GeCloudRESTResource.RENDERED_DATA_DOC: "rendered_data_doc", | ||
# Chetan - 20220812 - SUITE_VALIDATION_RESULT is deprecated by GX Cloud and is to be removed upon migration of E2E tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed CONTRACT
and SUITE_VALIDATION_RESULT
…_expectations into m/_/clean_up_cloud_rest_resource_enum
SUPPORT_EMAIL = "support@greatexpectations.io" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to cloud_constants.py
@@ -1077,7 +1075,7 @@ def save_profiler( | |||
key: Union[GeCloudIdentifier, ConfigurationIdentifier] | |||
if self.ge_cloud_mode: | |||
key = GeCloudIdentifier( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the name of GeCloudIdentifier, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm as long as Cloud doesn't directly use this! I don't think they though but lemme peruse the Mercury code first
@@ -203,7 +203,7 @@ def from_object(cls, validation_result): | |||
class GeCloudIdentifier(DataContextKey): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^
@@ -1191,7 +1191,7 @@ def get_profiler( | |||
key: Union[GeCloudIdentifier, ConfigurationIdentifier] | |||
if ge_cloud_id: | |||
key = GeCloudIdentifier( | |||
resource_type=GeCloudRESTResource.PROFILER, ge_cloud_id=ge_cloud_id | |||
resource_type=GXCloudRESTResource.PROFILER, ge_cloud_id=ge_cloud_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the method parameter too? from ge_cloud_id to gx_cloud_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good to me!
@@ -282,10 +282,10 @@ def test_list_keys( | |||
@pytest.mark.unit | |||
def test_remove_key( | |||
construct_ge_cloud_store_backend: Callable[ | |||
[GeCloudRESTResource], GeCloudStoreBackend | |||
[GXCloudRESTResource], GeCloudStoreBackend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also rename the GeCloudStoreBackend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that may break existing implementations due to our usage of instantiate_class_from_config
- do we perhaps want to deprecate that name?
…_expectations into m/_/clean_up_cloud_rest_resource_enum
…_expectations into m/_/clean_up_cloud_rest_resource_enum
…b.com/great-expectations/great_expectations into m/_/clean_up_cloud_rest_resource_enum
* develop: [MAINTENANCE] Update column_reflection_fallback to also use schema name for Trino (#6350) [MAINTENANCE] Misc cleanup of GX Cloud helpers (#6352) [MAINTENANCE] Pin `mypy` to `0.990` (#6361) Subject: Support to include ID/PK in validation result for each row t… (#5876) [MAINTENANCE] Fix computed metrics type hint in ExecutionEngine.resolve_metrics() method (#6347) [MAINTENANCE] Refactor `usage_stats_opt_out` method in DataContext (#5339) Zep PostgresDatasource returns a list of batches. (#6341) [DOCS] Add `yarn snippet-check` command (#6351) [MAINTENANCE] Refactor out `termcolor` dependency (#6348) [MAINTENANCE] Move Cloud-specific enums to `cloud_constants.py` (#6349)
Changes proposed in this pull request:
CONTRACT
andSUITE_VALIDATION_RESULT
are legacy and have been slated for removal for some time.GX
prefixget_context()
tests should work when you have env vars setmonkeypatch
so this is the caseDefinition of Done