Skip to content

Commit

Permalink
Update DbfsArtifactRepository logic that checks whether DBFS FUSE is …
Browse files Browse the repository at this point in the history
…available to not write to stdout (mlflow#1478)
  • Loading branch information
smurching authored and aarondav committed Jun 20, 2019
1 parent fcb6fa8 commit 279669f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mlflow/utils/databricks_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import logging
import subprocess

Expand Down Expand Up @@ -52,10 +53,12 @@ def is_in_databricks_notebook():


def is_dbfs_fuse_available():
try:
return subprocess.call(["mountpoint", "/dbfs"]) == 0
except Exception: # pylint: disable=broad-except
return False
with open(os.devnull, 'w') as devnull_stderr, open(os.devnull, 'w') as devnull_stdout:
try:
return subprocess.call(
["mountpoint", "/dbfs"], stderr=devnull_stderr, stdout=devnull_stdout) == 0
except Exception: # pylint: disable=broad-except
return False


def get_notebook_id():
Expand Down

0 comments on commit 279669f

Please sign in to comment.