You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/04/15 15:41:19 UTC

[GitHub] john-bodley commented on a change in pull request #4829: [import csv] ensure directory exists before saving csv file

john-bodley commented on a change in pull request #4829: [import csv] ensure directory exists before saving csv file
URL: https://github.com/apache/incubator-superset/pull/4829#discussion_r181587263
 
 

 ##########
 File path: superset/utils.py
 ##########
 @@ -827,3 +828,12 @@ def is_adhoc_metric(metric):
 
 def get_metric_names(metrics):
     return [metric['label'] if is_adhoc_metric(metric) else metric for metric in metrics]
+
+def ensure_path_exists(path):
+    try:
+        os.makedirs(path)
+    except OSError as exc:
+        if exc.errno == errno.EEXIST and os.path.isdir(path):
 
 Review comment:
   I would negate the conditions here removing the need for the pass.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services