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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to