-
Notifications
You must be signed in to change notification settings - Fork 258
Fix init(idempotent=True) / HailContext.getOrCreate #5872
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
Conversation
|
need to figure out how to properly stop. @henrydavidge do you know how to totally kill the java process from pyspark? |
|
I don't think there's a pyspark API to do that. You could try calling |
dismissing because I need to make some other changes
|
if pyspark doesn't have a way to do that, then I'd bet that there's some Python state that's not cleaned up if you try to restart it from the same Python runtime after killing the JVM. I can fix Hail to properly clean up, I think. |
|
@danking ready for another review. This PR has expanded because we needed to properly store/clear session-specific stuff in a bunch of places. |
hail/python/hail/expr/functions.py
Outdated
| rtype = tstruct(result=tinterval(tlocus(dest_reference_genome)), is_negative_strand=tbool) | ||
|
|
||
| if not rg.has_liftover(dest_reference_genome.name): | ||
| print(rg._liftovers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rogue print
hail/python/hail/ir/ir.py
Outdated
|
|
||
|
|
||
| _function_registry = {} | ||
| _seeded_function_registry = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should probably all be collections.defaultdict([]), there's a few places in here where we have extra code to handle the key not being present but if we consistently treated "not present" as empty list, things would be simpler, i.e. the remove_function is just:
f = (param_types, ret_type)
_function_registry[name] = [b for b in _function_registry[name] if b != f]
Also removes an if check in _lookup_function_return_type.
not required for the PR, but for future reference, I think this is an exemplary use case for defaultdict
|
It's definitely a bit unclear to met that we got everything and I'm not convinced the test checks everything. I don't think I'd feel much better unless we were randomly restarting the context mid tests. |
We actually do that -- this test_context runs in the same python process as the other tests. I also think we don't really guarantee you can stop and restart, but this at least makes it work with our tests. |
734812b to
736c1e7
Compare
No description provided.