phlo-core-plugins 0.16.0__tar.gz → 0.16.2__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.
Files changed (22) hide show
  1. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/PKG-INFO +2 -2
  2. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/README.md +9 -8
  3. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/pyproject.toml +2 -2
  4. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core_plugins.egg-info/PKG-INFO +2 -2
  5. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core_plugins.egg-info/requires.txt +1 -1
  6. phlo_core_plugins-0.16.2/tests/test_integration_core_plugins.py +36 -0
  7. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/tests/test_quality_plugins.py +16 -8
  8. phlo_core_plugins-0.16.0/tests/test_integration_core_plugins.py +0 -260
  9. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/setup.cfg +0 -0
  10. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/__init__.py +0 -0
  11. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/quality/__init__.py +0 -0
  12. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/quality/freshness_check.py +0 -0
  13. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/quality/null_check.py +0 -0
  14. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/quality/schema_check.py +0 -0
  15. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/quality/uniqueness_check.py +0 -0
  16. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/sources/__init__.py +0 -0
  17. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core/sources/rest_api.py +0 -0
  18. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core_plugins.egg-info/SOURCES.txt +0 -0
  19. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core_plugins.egg-info/dependency_links.txt +0 -0
  20. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core_plugins.egg-info/entry_points.txt +0 -0
  21. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/src/phlo_core_plugins.egg-info/top_level.txt +0 -0
  22. {phlo_core_plugins-0.16.0 → phlo_core_plugins-0.16.2}/tests/test_rest_api_plugin.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: phlo-core-plugins
3
- Version: 0.16.0
3
+ Version: 0.16.2
4
4
  Summary: Core plugin package for Phlo
5
5
  Author-email: Phlo Team <team@phlo.dev>
6
6
  License: MIT
7
7
  Requires-Python: >=3.12
8
8
  Description-Content-Type: text/plain
9
- Requires-Dist: phlo<0.18,>=0.17.0
9
+ Requires-Dist: phlo<0.20,>=0.19.0
10
10
  Requires-Dist: requests>=2.28.0
11
11
  Provides-Extra: dev
12
12
  Requires-Dist: pytest>=7.0; extra == "dev"
@@ -43,14 +43,15 @@ This package is **fully auto-configured**:
43
43
  ### Quality Checks
44
44
 
45
45
  ```python
46
- from phlo_quality.checks import null_check, uniqueness_check
46
+ import phlo
47
+ from phlo.quality import NullCheck, UniqueCheck
47
48
 
48
- @phlo_quality(
49
- asset="bronze.users",
49
+ @phlo.quality.pandera(
50
+ table="bronze.users",
50
51
  checks=[
51
- null_check(column="id"),
52
- uniqueness_check(column="email"),
53
- ]
52
+ NullCheck(columns=["id"]),
53
+ UniqueCheck(columns=["email"]),
54
+ ],
54
55
  )
55
56
  def validate_users():
56
57
  pass
@@ -59,9 +60,9 @@ def validate_users():
59
60
  ### Source Connectors
60
61
 
61
62
  ```python
62
- from phlo.ingestion import phlo_ingestion
63
+ import phlo
63
64
 
64
- @phlo_ingestion(
65
+ @phlo.ingest.dlt(
65
66
  name="api_data",
66
67
  source="rest_api", # Uses rest_api connector
67
68
  destination="bronze.api_data"
@@ -7,13 +7,13 @@ requires = [
7
7
 
8
8
  [project]
9
9
  dependencies = [
10
- "phlo>=0.17.0,<0.18",
10
+ "phlo>=0.19.0,<0.20",
11
11
  "requests>=2.28.0",
12
12
  ]
13
13
  description = "Core plugin package for Phlo"
14
14
  name = "phlo-core-plugins"
15
15
  requires-python = ">=3.12"
16
- version = "0.16.0"
16
+ version = "0.16.2"
17
17
 
18
18
  [[project.authors]]
19
19
  email = "team@phlo.dev"
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: phlo-core-plugins
3
- Version: 0.16.0
3
+ Version: 0.16.2
4
4
  Summary: Core plugin package for Phlo
5
5
  Author-email: Phlo Team <team@phlo.dev>
6
6
  License: MIT
7
7
  Requires-Python: >=3.12
8
8
  Description-Content-Type: text/plain
9
- Requires-Dist: phlo<0.18,>=0.17.0
9
+ Requires-Dist: phlo<0.20,>=0.19.0
10
10
  Requires-Dist: requests>=2.28.0
11
11
  Provides-Extra: dev
12
12
  Requires-Dist: pytest>=7.0; extra == "dev"
@@ -1,4 +1,4 @@
1
- phlo<0.18,>=0.17.0
1
+ phlo<0.20,>=0.19.0
2
2
  requests>=2.28.0
3
3
 
4
4
  [dev]
@@ -0,0 +1,36 @@
1
+ """Integration tests for phlo-core-plugins.
2
+
3
+ Per TEST_STRATEGY.md:
4
+ - Plugin Lifecycle: Registration, conflict resolution, metadata validation
5
+ """
6
+
7
+ import pytest
8
+
9
+ pytestmark = pytest.mark.integration
10
+
11
+
12
+ def test_service_plugin_requires_the_documented_interface() -> None:
13
+ """The service-plugin base class cannot supply metadata or a definition itself."""
14
+ from phlo.plugins import ServicePlugin
15
+
16
+ with pytest.raises(TypeError):
17
+ ServicePlugin()
18
+
19
+ class ConcretePlugin(ServicePlugin):
20
+ """Minimal implementation proving the base class accepts a real subclass."""
21
+
22
+ @property
23
+ def metadata(self):
24
+ """Return test plugin metadata."""
25
+ from phlo.plugins.base import PluginMetadata
26
+
27
+ return PluginMetadata("test", "1.0.0", "test")
28
+
29
+ @property
30
+ def service_definition(self):
31
+ """Return a minimal service definition."""
32
+ return {"services": {}}
33
+
34
+ plugin = ConcretePlugin()
35
+ assert plugin.metadata.name == "test"
36
+ assert plugin.service_definition == {"services": {}}
@@ -1,7 +1,7 @@
1
1
  """Tests for core quality check plugins.
2
2
 
3
3
  Each plugin is exercised through create_check() to confirm the generated check
4
- name matches the expected identifier for its check kind.
4
+ carries both the expected identifier and the configuration it was given.
5
5
  """
6
6
 
7
7
  from phlo_core.quality.freshness_check import FreshnessCheckPlugin
@@ -11,28 +11,34 @@ from phlo_core.quality.uniqueness_check import UniquenessCheckPlugin
11
11
 
12
12
 
13
13
  def test_null_check_plugin():
14
- """Verify null check plugin creates an expected check name."""
14
+ """Verify null check plugin creates a configured check."""
15
15
  plugin = NullCheckPlugin()
16
- check = plugin.create_check(columns=["id"])
16
+ check = plugin.create_check(columns=["id"], allow_threshold=0.25)
17
17
  assert check.name == "null_check_id"
18
+ assert check.columns == ["id"]
19
+ assert check.allow_threshold == 0.25
18
20
 
19
21
 
20
22
  def test_uniqueness_check_plugin():
21
- """Verify uniqueness check plugin creates an expected check name."""
23
+ """Verify uniqueness check plugin creates a configured check."""
22
24
  plugin = UniquenessCheckPlugin()
23
- check = plugin.create_check(columns=["id"])
25
+ check = plugin.create_check(columns=["id"], allow_threshold=0.02)
24
26
  assert check.name == "unique_check_id"
27
+ assert check.columns == ["id"]
28
+ assert check.allow_threshold == 0.02
25
29
 
26
30
 
27
31
  def test_freshness_check_plugin():
28
- """Verify freshness check plugin creates an expected check name."""
32
+ """Verify freshness check plugin creates a configured check."""
29
33
  plugin = FreshnessCheckPlugin()
30
34
  check = plugin.create_check(timestamp_column="ts", max_age_hours=2)
31
35
  assert check.name == "freshness_check_ts"
36
+ assert check.timestamp_column == "ts"
37
+ assert check.max_age_hours == 2
32
38
 
33
39
 
34
40
  def test_schema_check_plugin():
35
- """Verify schema check plugin creates an expected check name."""
41
+ """Verify schema check plugin creates a configured check."""
36
42
  plugin = SchemaCheckPlugin()
37
43
 
38
44
  class DummySchema:
@@ -44,5 +50,7 @@ def test_schema_check_plugin():
44
50
  """Return input dataframe unchanged."""
45
51
  return df
46
52
 
47
- check = plugin.create_check(schema=DummySchema)
53
+ check = plugin.create_check(schema=DummySchema, lazy=False)
48
54
  assert check.name == "schema_check_DummySchema"
55
+ assert check.schema is DummySchema
56
+ assert check.lazy is False
@@ -1,260 +0,0 @@
1
- """Comprehensive integration tests for phlo-core-plugins.
2
-
3
- Per TEST_STRATEGY.md:
4
- - Plugin Loading: Verify discovery mechanism
5
- - Plugin Lifecycle: Registration, conflict resolution, metadata validation
6
- """
7
-
8
- import pytest
9
-
10
- pytestmark = pytest.mark.integration
11
-
12
-
13
- # =============================================================================
14
- # Plugin Base Classes Tests
15
- # =============================================================================
16
-
17
-
18
- class TestPluginMetadata:
19
- """Test PluginMetadata functionality."""
20
-
21
- def test_plugin_metadata_creation(self):
22
- """Test creating PluginMetadata."""
23
- from phlo.plugins.base import PluginMetadata
24
-
25
- metadata = PluginMetadata(name="test-plugin", version="1.0.0", description="A test plugin")
26
-
27
- assert metadata.name == "test-plugin"
28
- assert metadata.version == "1.0.0"
29
- assert metadata.description == "A test plugin"
30
-
31
- def test_plugin_metadata_with_optional_fields(self):
32
- """Test PluginMetadata with optional fields."""
33
- from phlo.plugins.base import PluginMetadata
34
-
35
- metadata = PluginMetadata(
36
- name="full-plugin",
37
- version="2.0.0",
38
- description="Full featured plugin",
39
- author="Phlo Team",
40
- tags=["data", "pipeline"],
41
- )
42
-
43
- assert metadata.author == "Phlo Team"
44
- assert "data" in metadata.tags
45
-
46
-
47
- # =============================================================================
48
- # ServicePlugin Tests
49
- # =============================================================================
50
-
51
-
52
- class TestServicePlugin:
53
- """Test ServicePlugin base class."""
54
-
55
- def test_service_plugin_importable(self):
56
- """Test ServicePlugin is importable."""
57
- from phlo.plugins import ServicePlugin
58
-
59
- assert ServicePlugin is not None
60
-
61
- def test_service_plugin_is_abstract(self):
62
- """Test ServicePlugin requires implementation."""
63
- from phlo.plugins import ServicePlugin, PluginMetadata
64
-
65
- # Attempting to instantiate directly should fail or have abstract methods
66
- class ConcretePlugin(ServicePlugin):
67
- """Concrete service plugin for abstract base class testing."""
68
-
69
- @property
70
- def metadata(self):
71
- """Get test plugin metadata."""
72
- return PluginMetadata("test", "1.0.0", "test")
73
-
74
- @property
75
- def service_definition(self):
76
- """Get minimal service definition for test instantiation."""
77
- return {"services": {}}
78
-
79
- plugin = ConcretePlugin()
80
- assert plugin.metadata.name == "test"
81
-
82
-
83
- # =============================================================================
84
- # HookPlugin Tests
85
- # =============================================================================
86
-
87
-
88
- class TestHookPlugin:
89
- """Test HookPlugin base class."""
90
-
91
- def test_hook_plugin_importable(self):
92
- """Test HookPlugin is importable."""
93
- from phlo.plugins.hooks import HookPlugin
94
-
95
- assert HookPlugin is not None
96
-
97
- def test_hook_registration_structure(self):
98
- """Test HookRegistration structure."""
99
- from phlo.plugins.hooks import HookRegistration, HookFilter
100
-
101
- registration = HookRegistration(
102
- hook_name="test_hook",
103
- handler=lambda x: x,
104
- filters=HookFilter(event_types={"test.event"}),
105
- )
106
-
107
- assert registration.hook_name == "test_hook"
108
- assert callable(registration.handler)
109
-
110
- def test_hook_filter_creation(self):
111
- """Test HookFilter creation."""
112
- from phlo.plugins.hooks import HookFilter
113
-
114
- filter = HookFilter(event_types={"ingestion.start", "ingestion.end"})
115
-
116
- assert filter.event_types is not None
117
- assert "ingestion.start" in filter.event_types
118
-
119
-
120
- # =============================================================================
121
- # Plugin Discovery Tests
122
- # =============================================================================
123
-
124
-
125
- class TestPluginDiscovery:
126
- """Test plugin discovery mechanism."""
127
-
128
- def test_discover_plugins_function_exists(self):
129
- """Test discover_plugins function is importable."""
130
- from phlo.plugins.discovery import discover_plugins
131
-
132
- assert callable(discover_plugins)
133
-
134
- def test_discover_plugins_returns_dict(self):
135
- """Test discover_plugins returns a dictionary."""
136
- from phlo.plugins.discovery import discover_plugins
137
-
138
- # May return empty dict if no plugins installed
139
- result = discover_plugins(plugin_type="services", auto_register=False)
140
-
141
- assert isinstance(result, dict)
142
-
143
-
144
- # =============================================================================
145
- # CatalogPlugin Tests
146
- # =============================================================================
147
-
148
-
149
- class TestCatalogPlugin:
150
- """Test CatalogPlugin base class."""
151
-
152
- def test_catalog_plugin_importable(self):
153
- """Test CatalogPlugin is importable."""
154
- from phlo.plugins.base import CatalogPlugin
155
-
156
- assert CatalogPlugin is not None
157
-
158
- def test_catalog_plugin_interface(self):
159
- """Test CatalogPlugin interface."""
160
- from phlo.plugins.base import CatalogPlugin, PluginMetadata
161
-
162
- class MockCatalog(CatalogPlugin):
163
- """Concrete catalog plugin used to validate interface behavior."""
164
-
165
- @property
166
- def metadata(self):
167
- """Get mock catalog metadata."""
168
- return PluginMetadata("mock", "1.0.0", "Mock catalog")
169
-
170
- @property
171
- def targets(self) -> list[str]:
172
- """Get supported target engines."""
173
- return ["trino"]
174
-
175
- @property
176
- def catalog_name(self):
177
- """Get catalog identifier."""
178
- return "mock"
179
-
180
- def get_properties(self):
181
- """Get connector properties for the catalog."""
182
- return {"connector.name": "mock"}
183
-
184
- catalog = MockCatalog()
185
- assert catalog.catalog_name == "mock"
186
- assert catalog.get_properties()["connector.name"] == "mock"
187
-
188
-
189
- # =============================================================================
190
- # CLI Plugin Tests
191
- # =============================================================================
192
-
193
-
194
- class TestCliPlugin:
195
- """Test CLI plugin functionality."""
196
-
197
- def test_cli_plugin_base_importable(self):
198
- """Test CliCommandPlugin base is importable."""
199
- from phlo.plugins.base import CliCommandPlugin
200
-
201
- assert CliCommandPlugin is not None
202
-
203
-
204
- # =============================================================================
205
- # Plugin Integration Tests
206
- # =============================================================================
207
-
208
-
209
- class TestPluginIntegration:
210
- """Test plugin integration scenarios."""
211
-
212
- def test_multiple_plugin_types_coexist(self):
213
- """Test multiple plugin types can be discovered together."""
214
- from phlo.plugins import ServicePlugin
215
- from phlo.plugins.hooks import HookPlugin
216
-
217
- # Both should be importable
218
- assert ServicePlugin is not None
219
- assert HookPlugin is not None
220
-
221
- def test_plugin_metadata_serialization(self):
222
- """Test plugin metadata can be converted to dict."""
223
- from phlo.plugins.base import PluginMetadata
224
-
225
- metadata = PluginMetadata(name="test", version="1.0.0", description="Test")
226
-
227
- # Should have __dict__ or similar
228
- assert hasattr(metadata, "name")
229
- assert hasattr(metadata, "version")
230
-
231
-
232
- # =============================================================================
233
- # Export Tests
234
- # =============================================================================
235
-
236
-
237
- class TestCorePluginsExports:
238
- """Test core plugins exports."""
239
-
240
- def test_phlo_plugins_exports(self):
241
- """Test phlo.plugins exports expected classes."""
242
- from phlo.plugins import ServicePlugin, PluginMetadata
243
-
244
- assert ServicePlugin is not None
245
- assert PluginMetadata is not None
246
-
247
- def test_phlo_plugins_base_exports(self):
248
- """Test phlo.plugins.base exports expected classes."""
249
- from phlo.plugins.base import CatalogPlugin, PluginMetadata
250
-
251
- assert PluginMetadata is not None
252
- assert CatalogPlugin is not None
253
-
254
- def test_phlo_plugins_hooks_exports(self):
255
- """Test phlo.plugins.hooks exports expected classes."""
256
- from phlo.plugins.hooks import HookPlugin, HookRegistration, HookFilter
257
-
258
- assert HookPlugin is not None
259
- assert HookRegistration is not None
260
- assert HookFilter is not None