Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[query] ipython 1.18.1 (and possibly other versions) does not work with query on batch #14099

Open
danking opened this issue Dec 15, 2023 · 1 comment

Comments

@danking
Copy link
Contributor

danking commented Dec 15, 2023

What happened?

It seems like the event loop policy has changed again

Version

0.2.126

Relevant log output

(base) dking@wm28c-761 hail % HAIL_QUERY_BACKEND=service ipython
Python 3.10.9 (main, Jan 11 2023, 09:18:18) [Clang 14.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import hail as hl

In [2]: hl.init()
/Users/dking/miniconda3/lib/python3.10/site-packages/hail/context.py:350: UserWarning: The "service" backend is now called the "batch" backend. Support for "service" will be removed in a future release.
  warnings.warn(
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File ~/miniconda3/lib/python3.10/site-packages/hailtop/hail_event_loop.py:12, in hail_event_loop()
     11 try:
---> 12     asyncio.get_running_loop()
     13     nest_asyncio.apply()

RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
Cell In[2], line 1
----> 1 hl.init()

File <decorator-gen-1760>:2, in init(sc, app_name, master, local, log, quiet, append, min_block_size, branching_factor, tmp_dir, default_reference, idempotent, global_seed, spark_conf, skip_logging_configuration, local_tmpdir, _optimizer_iterations, backend, driver_cores, driver_memory, worker_cores, worker_memory, gcs_requester_pays_configuration, regions, gcs_bucket_allow_list)

File ~/miniconda3/lib/python3.10/site-packages/hail/typecheck/check.py:587, in _make_dec.<locals>.wrapper(__original_func, *args, **kwargs)
    584 @decorator
    585 def wrapper(__original_func: Callable[..., T], *args, **kwargs) -> T:
    586     args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 587     return __original_func(*args_, **kwargs_)

File ~/miniconda3/lib/python3.10/site-packages/hail/context.py:357, in init(sc, app_name, master, local, log, quiet, append, min_block_size, branching_factor, tmp_dir, default_reference, idempotent, global_seed, spark_conf, skip_logging_configuration, local_tmpdir, _optimizer_iterations, backend, driver_cores, driver_memory, worker_cores, worker_memory, gcs_requester_pays_configuration, regions, gcs_bucket_allow_list)
    354     backend = 'batch'
    356 if backend == 'batch':
--> 357     return hail_event_loop().run_until_complete(init_batch(
    358         log=log,
    359         quiet=quiet,
    360         append=append,
    361         tmpdir=tmp_dir,
    362         local_tmpdir=local_tmpdir,
    363         default_reference=default_reference,
    364         global_seed=global_seed,
    365         driver_cores=driver_cores,
    366         driver_memory=driver_memory,
    367         worker_cores=worker_cores,
    368         worker_memory=worker_memory,
    369         name_prefix=app_name,
    370         gcs_requester_pays_configuration=gcs_requester_pays_configuration,
    371         regions=regions,
    372         gcs_bucket_allow_list=gcs_bucket_allow_list
    373     ))
    374 if backend == 'spark':
    375     return init_spark(
    376         sc=sc,
    377         app_name=app_name,
   (...)
    392         gcs_requester_pays_configuration=gcs_requester_pays_configuration
    393     )

File ~/miniconda3/lib/python3.10/site-packages/hailtop/hail_event_loop.py:16, in hail_event_loop()
     14     return asyncio.get_running_loop()
     15 except RuntimeError:
---> 16     return asyncio.get_event_loop()

File ~/miniconda3/lib/python3.10/asyncio/events.py:671, in BaseDefaultEventLoopPolicy.get_event_loop(self)
    668     self.set_event_loop(self.new_event_loop())
    670 if self._local._loop is None:
--> 671     raise RuntimeError('There is no current event loop in thread %r.'
    672                        % threading.current_thread().name)
    674 return self._local._loop

RuntimeError: There is no current event loop in thread 'MainThread'.
@danking
Copy link
Contributor Author

danking commented Dec 15, 2023

Mitigation: pip3 install 'ipython<8.17'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant