Skip to content

Commit b3ee8fe

Browse files
committed
MOD: Revert to metadata.get_dataset_condition
1 parent 12f0156 commit b3ee8fe

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22

33
## 0.9.0 - TBD
4-
- Renamed `metadata.get_dataset_condition` to `metadata.list_dataset_conditions`
4+
- Changed `metadata.get_dataset_condition` response to a list of condition per date
55

66
## 0.8.1 - 2023-03-05
77
- Fixed bug in `Bento` iteration where multiple readers were created

databento/historical/api/metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def list_unit_prices(
242242
)
243243
return response.json()
244244

245-
def list_dataset_conditions(
245+
def get_dataset_condition(
246246
self,
247247
dataset: Union[Dataset, str],
248248
start_date: Optional[Union[date, str]] = None,
@@ -251,7 +251,7 @@ def list_dataset_conditions(
251251
"""
252252
Get the per date dataset conditions from Databento.
253253
254-
Makes a `GET /metadata.list_dataset_conditions` HTTP request.
254+
Makes a `GET /metadata.get_dataset_condition` HTTP request.
255255
256256
Use this method to discover data availability and quality.
257257
@@ -278,7 +278,7 @@ def list_dataset_conditions(
278278
]
279279

280280
response: Response = self._get(
281-
url=self._base_url + ".list_dataset_conditions",
281+
url=self._base_url + ".get_dataset_condition",
282282
params=params,
283283
basic_auth=True,
284284
)

examples/historical_metadata_list_dataset_conditions.py renamed to examples/historical_metadata_get_dataset_condition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
key = "YOUR_API_KEY"
88
client = Historical(key=key)
99

10-
conditions = client.metadata.list_dataset_conditions(dataset="XNAS.ITCH")
10+
condition = client.metadata.get_dataset_condition(dataset="XNAS.ITCH")
1111

12-
pprint(conditions)
12+
pprint(condition)

tests/test_historical_metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ def test_list_unit_price_sends_expected_request(
215215
assert isinstance(call["auth"], requests.auth.HTTPBasicAuth)
216216

217217
@pytest.mark.skipif(sys.version_info < (3, 8), reason="incompatible mocking")
218-
def test_list_dataset_conditions_sends_expected_request(
218+
def test_get_dataset_condition_sends_expected_request(
219219
self,
220220
mocker: MockerFixture,
221221
) -> None:
222222
# Arrange
223223
mocked_get = mocker.patch("requests.get")
224224

225225
# Act
226-
self.client.metadata.list_dataset_conditions(
226+
self.client.metadata.get_dataset_condition(
227227
dataset="GLBX.MDP3",
228228
start_date="2018-01-01",
229229
end_date="2020-01-01",
@@ -233,7 +233,7 @@ def test_list_dataset_conditions_sends_expected_request(
233233
call = mocked_get.call_args.kwargs
234234
assert (
235235
call["url"]
236-
== f"https://hist.databento.com/v{db.API_VERSION}/metadata.list_dataset_conditions" # noqa
236+
== f"https://hist.databento.com/v{db.API_VERSION}/metadata.get_dataset_condition" # noqa
237237
)
238238
assert ("dataset", "GLBX.MDP3") in call["params"]
239239
assert ("start_date", "2018-01-01") in call["params"]

0 commit comments

Comments
 (0)