Skip to content

Commit

Permalink
Update for frontend library
Browse files Browse the repository at this point in the history
  • Loading branch information
KyungEon Choi committed Apr 23, 2022
1 parent fcd6719 commit 2e4cdf5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ServiceX DataBinder

<p align="right"> Release v0.2.6 </p>
<p align="right"> Release v0.2.7 </p>

[![PyPI version](https://badge.fury.io/py/servicex-databinder.svg)](https://badge.fury.io/py/servicex-databinder)

Expand Down
2 changes: 1 addition & 1 deletion servicex_databinder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from .servicex_databinder import DataBinder

__version__ = '0.2.6'
__version__ = '0.2.7'

logging.basicConfig(format="%(levelname)s - %(message)s")
logging.getLogger(__name__).setLevel(logging.INFO)
11 changes: 7 additions & 4 deletions servicex_databinder/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ def get_servicex_data(self, test_run=False):

nest_asyncio.apply()

async def bound_get_data(sem, sx_ds, query):
# async def bound_get_data(sem, sx_ds, query):
async def bound_get_data(sem, sx_ds, query, sample):
async with sem:
return await sx_ds.get_data_parquet_async(query)
# return await sx_ds.get_data_parquet_async(query, 'test') # When fix in ServiceX Frontend
# return await sx_ds.get_data_parquet_async(query)
return await sx_ds.get_data_parquet_async(query, sample) # When fix in ServiceX Frontend

async def _get_my_data():
sem = asyncio.Semaphore(50) # Limit maximum concurrent ServiceX requests
Expand All @@ -60,8 +61,10 @@ async def _get_my_data():
session_generator=session, \
ignore_cache=ignoreCache)
query = request['query']
sample = request['Sample']

task = asyncio.ensure_future(bound_get_data(sem, sx_ds, query))
# task = asyncio.ensure_future(bound_get_data(sem, sx_ds, query))
task = asyncio.ensure_future(bound_get_data(sem, sx_ds, query, sample))
tasks.append(task)
return await asyncio.gather(*tasks)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_version(rel_path):
license="BSD 3-clause",
python_requires='>=3.6',
install_requires=[
"servicex>=2.4,<2.5",
"servicex>=2.5",
"tcut-to-qastle>=0.6",
"nest-asyncio>=1.5.1",
"tqdm>=4.60.0",
Expand Down

0 comments on commit 2e4cdf5

Please sign in to comment.