Beispiel #1
0
def dbnd_context():
    context = try_get_databand_context()
    if not context:
        # we are running without Databand Context
        # let create one inplace
        from dbnd._core.context.databand_context import DatabandContext  # noqa: F811

        context = DatabandContext.try_instance(name="inplace_run")
    return context
Beispiel #2
0
def dbnd_context():
    """Get or create databand context."""
    context = try_get_databand_context()
    if not context:
        # we are running without Databand Context
        # let create one inplace
        from dbnd._core.context.databand_context import (
            DatabandContext as _DatabandContext,
        )

        context = _DatabandContext.try_instance(name="inplace_run")
    return context
Beispiel #3
0
def get_databand_context():
    # type: () -> DatabandContext

    from dbnd._core.context.databand_context import DatabandContext  # noqa: F811

    return DatabandContext.try_instance()
Beispiel #4
0
def get_databand_context():
    # type: () -> DatabandContext
    """Databand Context get or create instance."""
    from dbnd._core.context.databand_context import DatabandContext as _DatabandContext

    return _DatabandContext.try_instance()