Skip to content

Commit

Permalink
Initialize config provider when running inside DB notebooks (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondav authored Jan 17, 2019
1 parent a4722e4 commit acb59b9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions databricks_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# pylint:disable=import-error
# pylint:disable=bare-except


def initialize_cli_for_databricks_notebooks():
import PythonShell
from databricksCli import init_databricks_cli_config_provider
init_databricks_cli_config_provider(PythonShell.IPython.get_ipython().user_ns.entry_point)

try:
# Initialize custom config provider which is available in Databricks notebooks.
initialize_cli_for_databricks_notebooks()
except:
pass

0 comments on commit acb59b9

Please sign in to comment.