Skip to content

Commit

Permalink
ENH: Fix formatting (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgilbert authored Jul 26, 2023
1 parent efb6f15 commit 5b35b2d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/blp/blp.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import datetime
import itertools
import json
import logging
import queue
import threading
from numbers import Number
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Sequence, Union
import json

import blpapi
import pandas
Expand Down Expand Up @@ -480,7 +480,6 @@ def dict_to_req(request: blpapi.Request, request_data: Dict) -> blpapi.Request:


class BlpQuery(BlpSession):

_SERVICES = {
"HistoricalDataRequest": "//blp/refdata",
"ReferenceDataRequest": "//blp/refdata",
Expand Down Expand Up @@ -569,7 +568,7 @@ def query(
request_data: Dict,
parse: Optional[Callable] = None,
collector: Optional[Callable] = None,
timeout: int = None,
timeout: Optional[int] = None,
):
"""Request and parse Bloomberg data.
Expand Down Expand Up @@ -854,15 +853,15 @@ def bql(
Returns: A pandas.DataFrame with columns ["security", "field", "secondary_name", "secondary_value", "value"]
Examples:
>>> bquery = blp.BlpQuery().start()
>>> bquery.bql(expression="get(px_last()) for(['AAPL US Equity', 'IBM US Equity'])")
>>> bquery = blp.BlpQuery().start() # doctest: +SKIP
>>> bquery.bql(expression="get(px_last()) for(['AAPL US Equity', 'IBM US Equity'])") # doctest: +SKIP
The resulting DataFrame will look like this:
security field secondary_name secondary_value value
0 AAPL US Equity px_last() CURRENCY USD 192.755005
1 IBM US Equity px_last() CURRENCY USD 139.289993
2 AAPL US Equity px_last() DATE 2023-07-24T00:00:00Z 192.755005
3 IBM US Equity px_last() DATE 2023-07-24T00:00:00Z 139.289993
security field secondary_name secondary_value value
0 AAPL US Equity px_last() CURRENCY USD 192.755005
1 IBM US Equity px_last() CURRENCY USD 139.289993
2 AAPL US Equity px_last() DATE 2023-07-24T00:00:00Z 192.755005
3 IBM US Equity px_last() DATE 2023-07-24T00:00:00Z 139.289993
"""
query = create_bql_query(expression, overrides, options)

Expand Down

0 comments on commit 5b35b2d

Please sign in to comment.