Ejemplo n.º 1
0
    def _use_spark_context_inplace(self):
        from dbnd_spark.spark_session import has_spark_session

        if isinstance(self.spark_engine, SparkLocalEngineConfig):
            if self.spark_engine.enable_spark_context_inplace and has_spark_session(
            ):
                return True

        if self.spark_config.use_current_spark_session and has_spark_session():
            return True

        return False
Ejemplo n.º 2
0
    def _use_spark_context_inplace(self):
        if isinstance(self.spark_engine, SparkLocalEngineConfig):
            if self.spark_engine.enable_spark_context_inplace:
                from dbnd_spark.spark_session import (
                    has_spark_session,
                    get_spark_session,
                )

                return has_spark_session()
        return False