Repository: ASFHyP3/hyp3-sdk

Issue:
Batch constructor should create an empty batch by default
Currently, calling `jobs = Batch()` raises `TypeError: __init__() missing 1 required positional argument: 'jobs'`.

To construct an empty batch, the user has to write `jobs = Batch([])`.  It would be more intuitive if this were the default behavior without having to explicitly provide an empty list.

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8905268..ddcacaa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) 
 and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+##  [0.3.3](https://github.com/ASFHyP3/hyp3-sdk/compare/v0.3.2...v0.3.3)
+### Added
+- SDK will attach a `User-Agent` statement like `hyp3_sdk/VERSION` to all API interactions
+
+### Changed
+- Providing a job list to `Batch.__init__()` is now optional; an empty batch will 
+  be created if the job list is not provided
+- `Batch.__init__()` no longer issues a warning when creating an empty batch
 
 ## [0.3.2](https://github.com/ASFHyP3/hyp3-sdk/compare/v0.3.1...v0.3.2)
 ### Changed
diff --git a/hyp3_sdk/jobs.py b/hyp3_sdk/jobs.py
index fbe8837..7866439 100644
--- a/hyp3_sdk/jobs.py
+++ b/hyp3_sdk/jobs.py
@@ -1,4 +1,3 @@
-import warnings
 from datetime import datetime
 from pathlib import Path
 from typing import List, Optional, Union
@@ -124,10 +123,9 @@ class Job:
 
 
 class Batch:
-    def __init__(self, jobs: List[Job]):
-        if len(jobs) == 0:
-            warnings.warn('Jobs list is empty; creating an empty Batch', UserWarning)
-
+    def __init__(self, jobs: Optional[List[Job]] = None):
+        if jobs is None:
+            jobs = []
         self.jobs = jobs
 
     def __len__(self):


Test patch:
diff --git a/tests/test_jobs.py b/tests/test_jobs.py
index 6d25cec..400f2d8 100644
--- a/tests/test_jobs.py
+++ b/tests/test_jobs.py
@@ -119,8 +119,10 @@ def test_job_download_files(tmp_path, get_mock_job):
 
 
 def test_batch_len():
-    with pytest.warns(UserWarning):
-        batch = Batch([])
+    batch = Batch()
+    assert len(batch) == 0
+
+    batch = Batch([])
     assert len(batch) == 0
 
     batch = Batch([Job.from_dict(SUCCEEDED_JOB), Job.from_dict(FAILED_JOB)])