discovery-engine-api 0.1.34__tar.gz → 0.1.37__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.
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/PKG-INFO +1 -1
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/discovery/__init__.py +1 -1
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/discovery/client.py +12 -10
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/pyproject.toml +1 -1
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/tests/test_client.py +5 -5
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/tests/test_client_e2e.py +3 -3
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/.gitignore +0 -0
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/README.md +0 -0
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/TESTING.md +0 -0
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/discovery/types.py +0 -0
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/publish.sh +0 -0
- {discovery_engine_api-0.1.34 → discovery_engine_api-0.1.37}/tests/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: discovery-engine-api
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.37
|
|
4
4
|
Summary: Python SDK for the Discovery Engine API
|
|
5
5
|
Project-URL: Homepage, https://github.com/leap-laboratories/discovery
|
|
6
6
|
Project-URL: Documentation, https://github.com/leap-laboratories/discovery
|
|
@@ -296,7 +296,7 @@ class Engine:
|
|
|
296
296
|
dataset_id: str,
|
|
297
297
|
target_column_id: str,
|
|
298
298
|
task: str = "regression",
|
|
299
|
-
|
|
299
|
+
depth_iterations: int = 1,
|
|
300
300
|
visibility: str = "public",
|
|
301
301
|
timeseries_groups: Optional[List[Dict[str, Any]]] = None,
|
|
302
302
|
target_column_override: Optional[str] = None,
|
|
@@ -311,7 +311,7 @@ class Engine:
|
|
|
311
311
|
dataset_id: Dataset ID
|
|
312
312
|
target_column_id: Target column ID
|
|
313
313
|
task: Task type (regression, binary_classification, multiclass_classification)
|
|
314
|
-
|
|
314
|
+
depth_iterations: Number of iterative feature removal cycles (1 = fastest)
|
|
315
315
|
visibility: Dataset visibility ("public" or "private")
|
|
316
316
|
timeseries_groups: Optional list of timeseries column groups
|
|
317
317
|
target_column_override: Optional override for target column name
|
|
@@ -327,7 +327,7 @@ class Engine:
|
|
|
327
327
|
payload = {
|
|
328
328
|
"run_target_column_id": target_column_id,
|
|
329
329
|
"task": task,
|
|
330
|
-
"
|
|
330
|
+
"depth_iterations": depth_iterations,
|
|
331
331
|
"visibility": visibility,
|
|
332
332
|
"auto_report_use_llm_evals": auto_report_use_llm_evals,
|
|
333
333
|
}
|
|
@@ -458,7 +458,7 @@ class Engine:
|
|
|
458
458
|
self,
|
|
459
459
|
file: Union[str, Path, "pd.DataFrame"],
|
|
460
460
|
target_column: str,
|
|
461
|
-
|
|
461
|
+
depth_iterations: int = 1,
|
|
462
462
|
title: Optional[str] = None,
|
|
463
463
|
description: Optional[str] = None,
|
|
464
464
|
column_descriptions: Optional[Dict[str, str]] = None,
|
|
@@ -483,7 +483,7 @@ class Engine:
|
|
|
483
483
|
Args:
|
|
484
484
|
file: File path, Path object, or pandas DataFrame
|
|
485
485
|
target_column: Name of the target column
|
|
486
|
-
|
|
486
|
+
depth_iterations: Number of iterative feature removal cycles (1 = fastest)
|
|
487
487
|
title: Optional dataset title
|
|
488
488
|
description: Optional dataset description
|
|
489
489
|
column_descriptions: Optional dict mapping column names to descriptions
|
|
@@ -535,7 +535,7 @@ class Engine:
|
|
|
535
535
|
files = {"file": (filename, file_content, mime_type)}
|
|
536
536
|
data: Dict[str, Any] = {
|
|
537
537
|
"target_column": target_column,
|
|
538
|
-
"
|
|
538
|
+
"depth_iterations": str(depth_iterations),
|
|
539
539
|
"visibility": visibility,
|
|
540
540
|
}
|
|
541
541
|
|
|
@@ -553,7 +553,9 @@ class Engine:
|
|
|
553
553
|
data["timeseries_groups"] = json.dumps(timeseries_groups)
|
|
554
554
|
|
|
555
555
|
# Call dashboard API to create report
|
|
556
|
-
print(
|
|
556
|
+
print(
|
|
557
|
+
f"🚀 Uploading file and creating run (depth: {depth_iterations}, target: {target_column})..."
|
|
558
|
+
)
|
|
557
559
|
# httpx automatically handles multipart/form-data when both files and data are provided
|
|
558
560
|
response = await client.post("/api/reports/create", files=files, data=data)
|
|
559
561
|
response.raise_for_status()
|
|
@@ -607,7 +609,7 @@ class Engine:
|
|
|
607
609
|
self,
|
|
608
610
|
file: Union[str, Path, "pd.DataFrame"],
|
|
609
611
|
target_column: str,
|
|
610
|
-
|
|
612
|
+
depth_iterations: int = 1,
|
|
611
613
|
title: Optional[str] = None,
|
|
612
614
|
description: Optional[str] = None,
|
|
613
615
|
column_descriptions: Optional[Dict[str, str]] = None,
|
|
@@ -631,7 +633,7 @@ class Engine:
|
|
|
631
633
|
Args:
|
|
632
634
|
file: File path, Path object, or pandas DataFrame
|
|
633
635
|
target_column: Name of the target column
|
|
634
|
-
|
|
636
|
+
depth_iterations: Number of iterative feature removal cycles (1 = fastest)
|
|
635
637
|
title: Optional dataset title
|
|
636
638
|
description: Optional dataset description
|
|
637
639
|
column_descriptions: Optional dict mapping column names to descriptions
|
|
@@ -653,7 +655,7 @@ class Engine:
|
|
|
653
655
|
coro = self.run_async(
|
|
654
656
|
file,
|
|
655
657
|
target_column,
|
|
656
|
-
|
|
658
|
+
depth_iterations,
|
|
657
659
|
title=title,
|
|
658
660
|
description=description,
|
|
659
661
|
column_descriptions=column_descriptions,
|
|
@@ -463,7 +463,7 @@ class TestCreateRun:
|
|
|
463
463
|
dataset_id=dataset_id,
|
|
464
464
|
target_column_id=target_column_id,
|
|
465
465
|
task="regression",
|
|
466
|
-
|
|
466
|
+
depth_iterations=1,
|
|
467
467
|
)
|
|
468
468
|
|
|
469
469
|
assert result == sample_run
|
|
@@ -472,7 +472,7 @@ class TestCreateRun:
|
|
|
472
472
|
payload = call_args[1]["json"]
|
|
473
473
|
assert payload["run_target_column_id"] == target_column_id
|
|
474
474
|
assert payload["task"] == "regression"
|
|
475
|
-
assert payload["
|
|
475
|
+
assert payload["depth_iterations"] == 1
|
|
476
476
|
|
|
477
477
|
@pytest.mark.asyncio
|
|
478
478
|
async def test_create_run_with_optional_params(self, client, mock_httpx_client, sample_run):
|
|
@@ -492,7 +492,7 @@ class TestCreateRun:
|
|
|
492
492
|
dataset_id=dataset_id,
|
|
493
493
|
target_column_id=target_column_id,
|
|
494
494
|
task="regression",
|
|
495
|
-
|
|
495
|
+
depth_iterations=1,
|
|
496
496
|
timeseries_groups=timeseries_groups,
|
|
497
497
|
target_column_override="price_override",
|
|
498
498
|
author="Test Author",
|
|
@@ -680,7 +680,7 @@ class TestRunAsync:
|
|
|
680
680
|
result = await client.run_async(
|
|
681
681
|
file=df,
|
|
682
682
|
target_column="price",
|
|
683
|
-
|
|
683
|
+
depth_iterations=1,
|
|
684
684
|
)
|
|
685
685
|
|
|
686
686
|
assert isinstance(result, EngineResult)
|
|
@@ -795,7 +795,7 @@ class TestRun:
|
|
|
795
795
|
result = client.run(
|
|
796
796
|
file=df,
|
|
797
797
|
target_column="price",
|
|
798
|
-
|
|
798
|
+
depth_iterations=1,
|
|
799
799
|
)
|
|
800
800
|
|
|
801
801
|
assert isinstance(result, EngineResult)
|
|
@@ -142,7 +142,7 @@ async def test_client_e2e_full_flow(engine, test_dataframe):
|
|
|
142
142
|
result = await engine.run_async(
|
|
143
143
|
file=test_dataframe,
|
|
144
144
|
target_column="price",
|
|
145
|
-
|
|
145
|
+
depth_iterations=1,
|
|
146
146
|
description="E2E test dataset - house price prediction",
|
|
147
147
|
column_descriptions={
|
|
148
148
|
"age": "Age of the property owner",
|
|
@@ -183,7 +183,7 @@ async def test_client_e2e_async_workflow(engine, test_dataframe):
|
|
|
183
183
|
result = await engine.run_async(
|
|
184
184
|
file=test_dataframe,
|
|
185
185
|
target_column="price",
|
|
186
|
-
|
|
186
|
+
depth_iterations=1,
|
|
187
187
|
auto_report_use_llm_evals=False,
|
|
188
188
|
wait=False, # Don't wait immediately
|
|
189
189
|
)
|
|
@@ -220,7 +220,7 @@ async def test_client_e2e_get_results(engine, test_dataframe):
|
|
|
220
220
|
result = await engine.run_async(
|
|
221
221
|
file=test_dataframe,
|
|
222
222
|
target_column="price",
|
|
223
|
-
|
|
223
|
+
depth_iterations=1,
|
|
224
224
|
auto_report_use_llm_evals=False,
|
|
225
225
|
wait=False,
|
|
226
226
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|