datatoolpack 0.7.3__tar.gz → 0.8.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datatoolpack
3
- Version: 0.7.3
3
+ Version: 0.8.0
4
4
  Summary: Official Python SDK for the AutoData ML data preparation pipeline API
5
5
  Home-page: https://autodata.datatoolpack.com
6
6
  Author: AutoData Team
@@ -1,4 +1,4 @@
1
1
  from .client import AutoDataClient, AutoDataError
2
2
 
3
- __version__ = "0.7.3"
3
+ __version__ = "0.8.0"
4
4
  __all__ = ["AutoDataClient", "AutoDataError", "__version__"]
@@ -74,7 +74,7 @@ class AutoDataClient:
74
74
  Args:
75
75
  api_key: API key string starting with ``dtpk_``.
76
76
  base_url: Base URL of the AutoData server (no trailing slash).
77
- timeout: HTTP request timeout in seconds (default 120).
77
+ timeout: HTTP request timeout in seconds (default 300).
78
78
  max_retries: Max automatic retries for transient errors
79
79
  (429 / 502 / 503 / 504). Default 3.
80
80
 
@@ -89,7 +89,7 @@ class AutoDataClient:
89
89
  api_key: Optional[str] = None,
90
90
  passcode: Optional[str] = None,
91
91
  base_url: Optional[str] = None,
92
- timeout: int = 120,
92
+ timeout: int = 300,
93
93
  max_retries: int = 3,
94
94
  ):
95
95
  # Resolve from env vars if not provided explicitly
@@ -195,7 +195,10 @@ class AutoDataClient:
195
195
  return response # let caller handle the error
196
196
  retry_after = int(response.headers.get("Retry-After", 0))
197
197
  wait = max(retry_after, 2 ** attempt)
198
- except requests.ConnectionError as exc:
198
+ except (requests.ConnectionError, requests.Timeout) as exc:
199
+ # Retry transient read/connect timeouts too: a long-running
200
+ # server-side stage can briefly delay a poll past the per-request
201
+ # timeout; that should not fail the whole job.
199
202
  last_exc = exc
200
203
  if attempt == self.max_retries:
201
204
  raise
@@ -364,7 +367,7 @@ class AutoDataClient:
364
367
  session_id: str,
365
368
  poll_interval: int = 2,
366
369
  timeout: Optional[float] = None,
367
- stall_timeout: float = 600.0,
370
+ stall_timeout: float = 3600.0,
368
371
  ) -> Dict:
369
372
  """Block until a session reaches *completed*, *error*, or *cancelled*.
370
373
 
@@ -405,6 +408,8 @@ class AutoDataClient:
405
408
  raise AutoDataError(f"Processing failed: {msg}")
406
409
  if status == "cancelled":
407
410
  raise AutoDataError("Processing was cancelled")
411
+ if status == "failed":
412
+ raise AutoDataError(f"Processing failed: {msg}")
408
413
 
409
414
  # Detect stalled workers: status stays 'unknown'/'processing' with
410
415
  # no progress change. Prevents infinite loops when cpu_worker died.
@@ -445,8 +450,14 @@ class AutoDataClient:
445
450
  session_id: Session to download.
446
451
  download_path: Directory to save files (created if needed).
447
452
  Defaults to ``./auto_data_outputs/<session_id>/``.
448
- output_preferences: Subset of filenames to include. ``None``
449
- downloads everything.
453
+ output_preferences: Subset of outputs to include. ``None``
454
+ downloads everything. Each entry can be
455
+ either the full filename
456
+ (``'dsg_output.csv'``) or the short key
457
+ (``'dsg_output'``); the SDK appends ``.csv``
458
+ to extensionless entries automatically.
459
+ Use ``'pipeline_report'`` (or
460
+ ``'pipeline_report.pdf'``) for the PDF report.
450
461
  compressed: If ``True`` (default), downloads a single ZIP
451
462
  archive and extracts it. If ``False``,
452
463
  downloads each file individually.
@@ -463,7 +474,29 @@ class AutoDataClient:
463
474
  if compressed:
464
475
  body: Dict = {}
465
476
  if output_preferences:
466
- body["files"] = output_preferences
477
+ # Server <= 0.7.3 used exact filename match — a user passing
478
+ # the key-form name ('dsg_output' instead of 'dsg_output.csv')
479
+ # got back an empty archive. Server >= 0.7.4 accepts both
480
+ # forms, but to keep older deployments working we also
481
+ # canonicalize on the client: if an entry has no extension,
482
+ # append the conventional .csv (which is correct for every
483
+ # AutoData output except pipeline_report → .pdf and the
484
+ # *_artifacts.pkl files, which users rarely cherry-pick).
485
+ EXTENSIONLESS_DEFAULTS = {
486
+ "pipeline_report": "pipeline_report.pdf",
487
+ }
488
+ normalized = []
489
+ for item in output_preferences:
490
+ item = str(item).strip()
491
+ if not item:
492
+ continue
493
+ if "." in item:
494
+ normalized.append(item)
495
+ elif item in EXTENSIONLESS_DEFAULTS:
496
+ normalized.append(EXTENSIONLESS_DEFAULTS[item])
497
+ else:
498
+ normalized.append(f"{item}.csv")
499
+ body["files"] = normalized
467
500
  r = self._request(
468
501
  "POST",
469
502
  self._url(f"/download-archive/{session_id}"),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datatoolpack
3
- Version: 0.7.3
3
+ Version: 0.8.0
4
4
  Summary: Official Python SDK for the AutoData ML data preparation pipeline API
5
5
  Home-page: https://autodata.datatoolpack.com
6
6
  Author: AutoData Team
@@ -7,7 +7,7 @@ with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
7
7
 
8
8
  setup(
9
9
  name="datatoolpack",
10
- version="0.7.3",
10
+ version="0.8.0",
11
11
  description="Official Python SDK for the AutoData ML data preparation pipeline API",
12
12
  long_description=long_description,
13
13
  long_description_content_type="text/markdown",
File without changes
File without changes