1065/enhancement/add ctx to __init__.py#1072
Conversation
|
To address @timsaucer's point from the issue, what about doing ctx = SessionContext.global_ctx()instead of just I don't really know the internals so I don't know what the difference is but I did find |
|
My question was more about ergonomics - now that we have the global context I suspect most users don't even need to import at all. In your use case, do you find you still need it? |
|
I see that the other PR makes functions for the file readers at the module level but AFAIK, there are still utilities only available through ctx. For example, we still have to do |
|
I recommend closing this PR or at lest changing it to: global_ctx = SessionContext.global_ctx()That I think will also help with making sure the naming is consistent. |
|
Closing since no activity. Please reopen PR if this continues to be a user's need. |
Which issue does this PR close?
Closes #1065
Rationale for this change
To improve ergonomics of the API by providing a pre-initialized
SessionContextinstance asctx. This allows users to import and use a context directly without initialization.What changes are included in this PR?
ctx = SessionContext()in__init__.pyto provide a default context instancetest_default_ctx_instanceto verify functionalityctxin__all__for explicit exportsAre there any user-facing changes?
Yes, users can now do:
Instead of:
It adds a new API for the users.