great-expectations-cloud 20250917.0__tar.gz → 20250918.0.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of great-expectations-cloud might be problematic. Click here for more details.

Files changed (33) hide show
  1. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/PKG-INFO +1 -1
  2. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/agent_action.py +3 -3
  3. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/draft_datasource_config_action.py +6 -12
  4. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/generate_data_quality_check_expectations_action.py +5 -6
  5. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/list_asset_names.py +2 -6
  6. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/run_metric_list_action.py +3 -3
  7. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/run_scheduled_checkpoint.py +1 -1
  8. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/run_window_checkpoint.py +1 -1
  9. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/agent.py +2 -1
  10. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/event_handler.py +8 -7
  11. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/models.py +12 -0
  12. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/pyproject.toml +2 -2
  13. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/LICENSE +0 -0
  14. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/README.md +0 -0
  15. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/__init__.py +0 -0
  16. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/__init__.py +0 -0
  17. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/__init__.py +0 -0
  18. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/run_checkpoint.py +0 -0
  19. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/unknown.py +0 -0
  20. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/actions/utils.py +0 -0
  21. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/agent_warnings.py +0 -0
  22. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/cli.py +0 -0
  23. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/config.py +0 -0
  24. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/constants.py +0 -0
  25. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/exceptions.py +0 -0
  26. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/message_service/__init__.py +0 -0
  27. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/message_service/asyncio_rabbit_mq_client.py +0 -0
  28. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/message_service/subscriber.py +0 -0
  29. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/run.py +0 -0
  30. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/agent/utils.py +0 -0
  31. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/logging/README.md +0 -0
  32. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/logging/logging_cfg.py +0 -0
  33. {great_expectations_cloud-20250917.0 → great_expectations_cloud-20250918.0.dev1}/great_expectations_cloud/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: great_expectations_cloud
3
- Version: 20250917.0
3
+ Version: 20250918.0.dev1
4
4
  Summary: Great Expectations Cloud
5
5
  License: Proprietary
6
6
  Author: The Great Expectations Team
@@ -4,7 +4,6 @@ import datetime
4
4
  from abc import abstractmethod
5
5
  from collections.abc import Sequence
6
6
  from typing import TYPE_CHECKING, Generic, Optional, TypeVar, Union
7
- from uuid import UUID
8
7
 
9
8
  from pydantic.v1 import BaseModel
10
9
 
@@ -12,6 +11,7 @@ from great_expectations_cloud.agent.models import (
12
11
  AgentBaseExtraForbid,
13
12
  AgentBaseExtraIgnore,
14
13
  CreatedResource,
14
+ DomainContext,
15
15
  )
16
16
 
17
17
  if TYPE_CHECKING:
@@ -32,11 +32,11 @@ _EventT = TypeVar("_EventT", bound=Union[AgentBaseExtraForbid, AgentBaseExtraIgn
32
32
 
33
33
  class AgentAction(Generic[_EventT]):
34
34
  def __init__(
35
- self, context: CloudDataContext, base_url: str, organization_id: UUID, auth_key: str
35
+ self, context: CloudDataContext, base_url: str, domain_context: DomainContext, auth_key: str
36
36
  ):
37
37
  self._context = context
38
38
  self._base_url = base_url
39
- self._organization_id = organization_id
39
+ self._domain_context = domain_context
40
40
  self._auth_key = auth_key
41
41
 
42
42
  @abstractmethod
@@ -40,9 +40,7 @@ class DraftDatasourceConfigAction(AgentAction[DraftDatasourceConfigEvent]):
40
40
  def check_draft_datasource_config(
41
41
  self, event: DraftDatasourceConfigEvent, id: str
42
42
  ) -> ActionResult:
43
- draft_config = self.get_draft_config(
44
- config_id=event.config_id, workspace_id=event.workspace_id
45
- )
43
+ draft_config = self.get_draft_config(config_id=event.config_id)
46
44
  datasource_type = draft_config.get("type", None)
47
45
  if datasource_type is None:
48
46
  raise TypeError( # noqa: TRY003 # one off error
@@ -60,9 +58,7 @@ class DraftDatasourceConfigAction(AgentAction[DraftDatasourceConfigEvent]):
60
58
 
61
59
  if isinstance(datasource, SQLDatasource):
62
60
  asset_names = get_asset_names(datasource)
63
- self._update_asset_names_list(
64
- config_id=event.config_id, workspace_id=event.workspace_id, asset_names=asset_names
65
- )
61
+ self._update_asset_names_list(config_id=event.config_id, asset_names=asset_names)
66
62
 
67
63
  return ActionResult(
68
64
  id=id,
@@ -70,13 +66,11 @@ class DraftDatasourceConfigAction(AgentAction[DraftDatasourceConfigEvent]):
70
66
  created_resources=[],
71
67
  )
72
68
 
73
- def _update_asset_names_list(
74
- self, config_id: UUID, workspace_id: UUID, asset_names: list[str]
75
- ) -> None:
69
+ def _update_asset_names_list(self, config_id: UUID, asset_names: list[str]) -> None:
76
70
  with create_session(access_token=self._auth_key) as session:
77
71
  url = urljoin(
78
72
  base=self._base_url,
79
- url=f"/api/v1/organizations/{self._organization_id}/workspaces/{workspace_id}/draft-table-names/{config_id}",
73
+ url=f"/api/v1/organizations/{self._domain_context.organization_id}/workspaces/{self._domain_context.workspace_id}/draft-table-names/{config_id}",
80
74
  )
81
75
  response = session.put(
82
76
  url=url,
@@ -90,10 +84,10 @@ class DraftDatasourceConfigAction(AgentAction[DraftDatasourceConfigEvent]):
90
84
  f"={config_id}.",
91
85
  )
92
86
 
93
- def get_draft_config(self, config_id: UUID, workspace_id: UUID) -> dict[str, Any]:
87
+ def get_draft_config(self, config_id: UUID) -> dict[str, Any]:
94
88
  resource_url = urljoin(
95
89
  base=self._base_url,
96
- url=f"/api/v1/organizations/{self._organization_id}/workspaces/{workspace_id}/draft-datasources/{config_id}",
90
+ url=f"/api/v1/organizations/{self._domain_context.organization_id}/workspaces/{self._domain_context.workspace_id}/draft-datasources/{config_id}",
97
91
  )
98
92
  with create_session(access_token=self._auth_key) as session:
99
93
  response = session.get(resource_url)
@@ -43,6 +43,7 @@ from great_expectations_cloud.agent.event_handler import register_event_action
43
43
  from great_expectations_cloud.agent.exceptions import GXAgentError
44
44
  from great_expectations_cloud.agent.models import (
45
45
  CreatedResource,
46
+ DomainContext,
46
47
  GenerateDataQualityCheckExpectationsEvent,
47
48
  )
48
49
  from great_expectations_cloud.agent.utils import (
@@ -83,13 +84,13 @@ class GenerateDataQualityCheckExpectationsAction(
83
84
  self,
84
85
  context: CloudDataContext,
85
86
  base_url: str,
86
- organization_id: UUID,
87
+ domain_context: DomainContext,
87
88
  auth_key: str,
88
89
  metric_repository: MetricRepository | None = None,
89
90
  batch_inspector: BatchInspector | None = None,
90
91
  ):
91
92
  super().__init__(
92
- context=context, base_url=base_url, organization_id=organization_id, auth_key=auth_key
93
+ context=context, base_url=base_url, domain_context=domain_context, auth_key=auth_key
93
94
  )
94
95
  self._metric_repository = metric_repository or MetricRepository(
95
96
  data_store=CloudDataStore(self._context)
@@ -100,8 +101,6 @@ class GenerateDataQualityCheckExpectationsAction(
100
101
 
101
102
  @override
102
103
  def run(self, event: GenerateDataQualityCheckExpectationsEvent, id: str) -> ActionResult:
103
- self._workspace_id = event.workspace_id
104
-
105
104
  created_resources: list[CreatedResource] = []
106
105
  assets_with_errors: list[str] = []
107
106
  selected_dqis: Sequence[DataQualityIssues] = event.selected_data_quality_issues or []
@@ -225,7 +224,7 @@ class GenerateDataQualityCheckExpectationsAction(
225
224
  """
226
225
  url = urljoin(
227
226
  base=self._base_url,
228
- url=f"/api/v1/organizations/{self._organization_id}/workspaces/{self._workspace_id}/expectations/",
227
+ url=f"/api/v1/organizations/{self._domain_context.organization_id}/workspaces/{self._domain_context.workspace_id}/expectations/",
229
228
  )
230
229
  with create_session(access_token=self._auth_key) as session:
231
230
  response = session.get(
@@ -527,7 +526,7 @@ class GenerateDataQualityCheckExpectationsAction(
527
526
  ) -> UUID:
528
527
  url = urljoin(
529
528
  base=self._base_url,
530
- url=f"/api/v1/organizations/{self._organization_id}/workspaces/{self._workspace_id}/expectations/{asset_id}",
529
+ url=f"/api/v1/organizations/{self._domain_context.organization_id}/workspaces/{self._domain_context.workspace_id}/expectations/{asset_id}",
531
530
  )
532
531
 
533
532
  expectation_payload = expectation.configuration.to_json_dict()
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from urllib.parse import urljoin
4
- from uuid import UUID
5
4
 
6
5
  from great_expectations.core.http import create_session
7
6
  from great_expectations.datasource.fluent import SQLDatasource
@@ -34,7 +33,6 @@ class ListAssetNamesAction(AgentAction[ListAssetNamesEvent]):
34
33
 
35
34
  self._add_or_update_asset_names_list(
36
35
  datasource_id=str(datasource.id),
37
- workspace_id=event.workspace_id,
38
36
  asset_names=asset_names,
39
37
  )
40
38
 
@@ -44,13 +42,11 @@ class ListAssetNamesAction(AgentAction[ListAssetNamesEvent]):
44
42
  created_resources=[],
45
43
  )
46
44
 
47
- def _add_or_update_asset_names_list(
48
- self, datasource_id: str, workspace_id: UUID, asset_names: list[str]
49
- ) -> None:
45
+ def _add_or_update_asset_names_list(self, datasource_id: str, asset_names: list[str]) -> None:
50
46
  with create_session(access_token=self._auth_key) as session:
51
47
  url = urljoin(
52
48
  base=self._base_url,
53
- url=f"/api/v1/organizations/{self._organization_id}/workspaces/{workspace_id}/table-names/{datasource_id}",
49
+ url=f"/api/v1/organizations/{self._domain_context.organization_id}/workspaces/{self._domain_context.workspace_id}/table-names/{datasource_id}",
54
50
  )
55
51
  response = session.put(
56
52
  url=url,
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING
4
- from uuid import UUID
5
4
 
6
5
  from great_expectations.experimental.metric_repository.batch_inspector import (
7
6
  BatchInspector,
@@ -21,6 +20,7 @@ from great_expectations_cloud.agent.actions import ActionResult, AgentAction
21
20
  from great_expectations_cloud.agent.event_handler import register_event_action
22
21
  from great_expectations_cloud.agent.models import (
23
22
  CreatedResource,
23
+ DomainContext,
24
24
  RunMetricsListEvent,
25
25
  )
26
26
 
@@ -34,13 +34,13 @@ class MetricListAction(AgentAction[RunMetricsListEvent]):
34
34
  self,
35
35
  context: CloudDataContext,
36
36
  base_url: str,
37
- organization_id: UUID,
37
+ domain_context: DomainContext,
38
38
  auth_key: str,
39
39
  metric_repository: MetricRepository | None = None,
40
40
  batch_inspector: BatchInspector | None = None,
41
41
  ):
42
42
  super().__init__(
43
- context=context, base_url=base_url, organization_id=organization_id, auth_key=auth_key
43
+ context=context, base_url=base_url, domain_context=domain_context, auth_key=auth_key
44
44
  )
45
45
  self._metric_repository = metric_repository or MetricRepository(
46
46
  data_store=CloudDataStore(self._context)
@@ -24,7 +24,7 @@ class RunScheduledCheckpointAction(AgentAction[RunScheduledCheckpointEvent]):
24
24
  def run(self, event: RunScheduledCheckpointEvent, id: str) -> ActionResult:
25
25
  expectation_parameters_url = urljoin(
26
26
  base=self._base_url,
27
- url=f"/api/v1/organizations/{self._organization_id}/workspaces/{event.workspace_id}/checkpoints/{event.checkpoint_id}/expectation-parameters",
27
+ url=f"/api/v1/organizations/{self._domain_context.organization_id}/workspaces/{self._domain_context.workspace_id}/checkpoints/{event.checkpoint_id}/expectation-parameters",
28
28
  )
29
29
  return run_scheduled_checkpoint(
30
30
  context=self._context,
@@ -24,7 +24,7 @@ class RunWindowCheckpointAction(AgentAction[RunWindowCheckpointEvent]):
24
24
  def run(self, event: RunWindowCheckpointEvent, id: str) -> ActionResult:
25
25
  expectation_parameters_url = urljoin(
26
26
  base=self._base_url,
27
- url=f"/api/v1/organizations/{self._organization_id}/workspaces/{event.workspace_id}/checkpoints/{event.checkpoint_id}/expectation-parameters",
27
+ url=f"/api/v1/organizations/{self._domain_context.organization_id}/workspaces/{self._domain_context.workspace_id}/checkpoints/{event.checkpoint_id}/expectation-parameters",
28
28
  )
29
29
  return run_window_checkpoint(
30
30
  self._context,
@@ -65,6 +65,7 @@ from great_expectations_cloud.agent.models import (
65
65
  AgentBaseExtraForbid,
66
66
  CreateScheduledJobAndSetJobStarted,
67
67
  CreateScheduledJobAndSetJobStartedRequest,
68
+ DomainContext,
68
69
  JobCompleted,
69
70
  JobStarted,
70
71
  JobStatus,
@@ -363,7 +364,7 @@ class GXAgent:
363
364
  id=event_context.correlation_id,
364
365
  base_url=base_url,
365
366
  auth_key=auth_key,
366
- organization_id=org_id,
367
+ domain_context=DomainContext(organization_id=org_id, workspace_id=workspace_id),
367
368
  )
368
369
  return result
369
370
 
@@ -15,6 +15,7 @@ from pydantic import v1 as pydantic_v1
15
15
  from great_expectations_cloud.agent.actions.unknown import UnknownEventAction
16
16
  from great_expectations_cloud.agent.exceptions import GXAgentError
17
17
  from great_expectations_cloud.agent.models import (
18
+ DomainContext,
18
19
  Event,
19
20
  EventType,
20
21
  UnknownEvent,
@@ -67,11 +68,11 @@ class EventHandler:
67
68
  self._context = context
68
69
 
69
70
  def get_event_action(
70
- self, event: Event, base_url: str, auth_key: str, organization_id: UUID
71
+ self, event: Event, base_url: str, auth_key: str, domain_context: DomainContext
71
72
  ) -> AgentAction[Any]:
72
73
  """Get the action that should be run for the given event."""
73
74
 
74
- if not self._check_event_organization_id(event, organization_id):
75
+ if not self._check_event_organization_id(event, domain_context.organization_id):
75
76
  # Making message more generic
76
77
  raise GXAgentError("Unable to process job. Invalid input.") # noqa: TRY003
77
78
 
@@ -84,17 +85,17 @@ class EventHandler:
84
85
  return action_class(
85
86
  context=self._context,
86
87
  base_url=base_url,
87
- organization_id=organization_id,
88
+ domain_context=domain_context,
88
89
  auth_key=auth_key,
89
90
  )
90
91
 
91
- def handle_event( # Refactor opportunity
92
- self, event: Event, id: str, base_url: str, auth_key: str, organization_id: UUID
92
+ def handle_event(
93
+ self, event: Event, id: str, base_url: str, auth_key: str, domain_context: DomainContext
93
94
  ) -> ActionResult:
94
- start_time = datetime.now(tz=timezone.utc)
95
95
  """Transform an Event into an ActionResult."""
96
+ start_time = datetime.now(tz=timezone.utc)
96
97
  action = self.get_event_action(
97
- event=event, base_url=base_url, auth_key=auth_key, organization_id=organization_id
98
+ event=event, base_url=base_url, auth_key=auth_key, domain_context=domain_context
98
99
  )
99
100
  LOGGER.info(f"Handling event: {event.type} -> {action.__class__.__name__}")
100
101
  action_result = action.run(event=event, id=id)
@@ -24,6 +24,18 @@ def all_subclasses(cls: type) -> list[type]:
24
24
  return all_sub_cls
25
25
 
26
26
 
27
+ class DomainContext(BaseModel):
28
+ """
29
+ Encapsulates domain-related context information.
30
+
31
+ This dataclass consolidates organization_id and workspace_id to reduce
32
+ parameter proliferation and improve code maintainability.
33
+ """
34
+
35
+ organization_id: UUID
36
+ workspace_id: UUID
37
+
38
+
27
39
  class AgentBaseExtraForbid(BaseModel):
28
40
  class Config:
29
41
  # 2024-03-04: ZEL-501 Strictly enforce models for handling outdated APIs
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "great_expectations_cloud"
3
- version = "20250917.0"
3
+ version = "20250918.0.dev1"
4
4
  description = "Great Expectations Cloud"
5
5
  authors = ["The Great Expectations Team <team@greatexpectations.io>"]
6
6
  repository = "https://github.com/great-expectations/cloud"
@@ -46,7 +46,7 @@ pytest-cov = ">=5"
46
46
  pytest-icdiff = "*"
47
47
  pytest-mock = "*"
48
48
  responses = ">=0.23.1,<0.26.0"
49
- ruff = "0.13.0"
49
+ ruff = "0.13.1"
50
50
  tenacity = ">=8.2.3,<10.0.0"
51
51
  tomlkit = ">=0.12.1,<0.14.0"
52
52
  types-requests = "^2.31"