Skip to content

Commit 0b3eb5b

Browse files
committed
MOD: Rename batch.timeseries_submit to batch.submit_job
1 parent 7279cb6 commit 0b3eb5b

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

databento/historical/api/batch.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, key, gateway):
3030
super().__init__(key=key, gateway=gateway)
3131
self._base_url = gateway + f"/v{API_VERSION}/batch"
3232

33-
def timeseries_submit(
33+
def submit_job(
3434
self,
3535
dataset: Union[Dataset, str],
3636
symbols: Optional[Union[List[str], str]] = None,
@@ -48,9 +48,9 @@ def timeseries_submit(
4848
limit: Optional[int] = None,
4949
) -> Dict[str, Any]:
5050
"""
51-
Request a new time series batch data job from Databento.
51+
Request a new time series data batch job from Databento.
5252
53-
Makes a `POST /batch.timeseries_submit` HTTP request.
53+
Makes a `POST /batch.submit_job` HTTP request.
5454
5555
Parameters
5656
----------
@@ -141,7 +141,7 @@ def timeseries_submit(
141141
params.append(("split_size", str(split_size)))
142142

143143
return self._post(
144-
url=self._base_url + ".timeseries_submit",
144+
url=self._base_url + ".submit_job",
145145
params=params,
146146
basic_auth=True,
147147
).json()
@@ -152,7 +152,7 @@ def list_jobs(
152152
since: Optional[Union[pd.Timestamp, date, str, int]] = None,
153153
) -> List[Dict[str, Any]]:
154154
"""
155-
Request all batch data job details for the user account.
155+
Request all batch job details for the user account.
156156
157157
The job details will be sorted in order of `ts_received`.
158158

databento/historical/api/timeseries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def stream(
3232
path: Optional[str] = None,
3333
) -> Bento:
3434
"""
35-
Request a historical time series stream from Databento.
35+
Request a historical time series data stream from Databento.
3636
3737
Makes a `GET /timeseries.stream` HTTP request.
3838
@@ -129,7 +129,7 @@ async def stream_async(
129129
path: Optional[str] = None,
130130
) -> Bento:
131131
"""
132-
Request a historical time series stream from Databento asynchronously.
132+
Request a historical time series data stream from Databento asynchronously.
133133
134134
Makes a `GET /timeseries.stream` HTTP request.
135135

examples/historical_batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
key = "YOUR_API_KEY"
1010
client = db.Historical(key=key)
1111

12-
response = client.batch.timeseries_submit(
12+
response = client.batch.submit_job(
1313
dataset="GLBX.MDP3",
1414
symbols=["ESH1"],
1515
schema="mbo",

notebooks/quickstart.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"- Using the historical client to request time series market data\n",
2929
"- Working with Bento data I/O helper objects\n",
3030
"- Using the historical client to make batch data requests\n",
31-
"- Querying batch data job states\n",
31+
"- Querying batch job states\n",
3232
"\n",
3333
"**Tip:** You can call help() on any class or method to see the 'docstring.'"
3434
]
@@ -1416,7 +1416,7 @@
14161416
}
14171417
],
14181418
"source": [
1419-
"client.batch.timeseries_submit(\n",
1419+
"client.batch.submit_job(\n",
14201420
" dataset=\"GLBX.MDP3\",\n",
14211421
" symbols=[\"ESH1\"],\n",
14221422
" schema=\"trades\",\n",
@@ -1434,7 +1434,7 @@
14341434
"id": "ec29b7b2-612a-4bbe-bd70-460b08e3866e",
14351435
"metadata": {},
14361436
"source": [
1437-
"## Querying batch data job state\n",
1437+
"## Querying batch job state\n",
14381438
"\n",
14391439
"It's possible to query for a list of your batch jobs, with optional filter parameters for `state` and `since`. This could help to programatically build and manage larger data pipelines."
14401440
]

tests/test_historical_batch.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ def setup(self) -> None:
1010
key = "DUMMY_API_KEY"
1111
self.client = db.Historical(key=key)
1212

13-
def test_batch_timeseries_submit_given_invalid_schema_raises_error(self) -> None:
13+
def test_batch_submit_job_given_invalid_schema_raises_error(self) -> None:
1414
# Arrange, Act, Assert
1515
with pytest.raises(ValueError):
16-
self.client.batch.timeseries_submit(
16+
self.client.batch.submit_job(
1717
dataset="GLBX.MDP3",
1818
symbols=["ES"],
1919
schema="ticks", # <--- invalid
@@ -22,10 +22,10 @@ def test_batch_timeseries_submit_given_invalid_schema_raises_error(self) -> None
2222
encoding="csv",
2323
)
2424

25-
def test_batch_timeseries_submit_given_invalid_encoding_raises_error(self) -> None:
25+
def test_batch_submit_job_given_invalid_encoding_raises_error(self) -> None:
2626
# Arrange, Act, Assert
2727
with pytest.raises(ValueError):
28-
self.client.batch.timeseries_submit(
28+
self.client.batch.submit_job(
2929
dataset="GLBX.MDP3",
3030
symbols=["ES"],
3131
schema="mbo",
@@ -34,10 +34,10 @@ def test_batch_timeseries_submit_given_invalid_encoding_raises_error(self) -> No
3434
encoding="gzip", # <--- invalid
3535
)
3636

37-
def test_batch_timeseries_submit_given_invalid_stype_in_raises_error(self) -> None:
37+
def test_batch_submit_job_given_invalid_stype_in_raises_error(self) -> None:
3838
# Arrange, Act, Assert
3939
with pytest.raises(ValueError):
40-
self.client.batch.timeseries_submit(
40+
self.client.batch.submit_job(
4141
dataset="GLBX.MDP3",
4242
symbols="ESH1",
4343
schema="mbo",
@@ -49,12 +49,12 @@ def test_batch_timeseries_submit_given_invalid_stype_in_raises_error(self) -> No
4949
)
5050

5151
@pytest.mark.skipif(sys.version_info < (3, 8), reason="incompatible mocking")
52-
def test_batch_timeseries_submit_sends_expected_request(self, mocker) -> None:
52+
def test_batch_submit_job_sends_expected_request(self, mocker) -> None:
5353
# Arrange
5454
mocked_get = mocker.patch("requests.post")
5555

5656
# Act
57-
self.client.batch.timeseries_submit(
57+
self.client.batch.submit_job(
5858
dataset="GLBX.MDP3",
5959
symbols="ESH1",
6060
schema="trades",
@@ -72,7 +72,7 @@ def test_batch_timeseries_submit_sends_expected_request(self, mocker) -> None:
7272
call = mocked_get.call_args.kwargs
7373
assert (
7474
call["url"]
75-
== f"https://hist.databento.com/v{db.API_VERSION}/batch.timeseries_submit"
75+
== f"https://hist.databento.com/v{db.API_VERSION}/batch.submit_job"
7676
)
7777
assert sorted(call["headers"].keys()) == ["accept", "user-agent"]
7878
assert call["headers"]["accept"] == "application/json"

0 commit comments

Comments
 (0)