Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[import csv] ensure directory exists before saving csv file #4829

Merged
merged 1 commit into from Apr 18, 2018

Conversation

timifasubaa
Copy link
Contributor

Some users complained of the error while uploading CSV whereby the first uploading phase fails because directory does not exist. This PR adds an extra check to ensure the directory exists before saving the csv file.

Fixes #4576

@timifasubaa timifasubaa force-pushed the ensure_csv_path_exists branch 3 times, most recently from a093828 to 2657299 Compare April 15, 2018 08:38
@codecov-io
Copy link

codecov-io commented Apr 15, 2018

Codecov Report

Merging #4829 into master will increase coverage by 0.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4829      +/-   ##
==========================================
+ Coverage   76.91%   76.93%   +0.01%     
==========================================
  Files          44       44              
  Lines        8522     8531       +9     
==========================================
+ Hits         6555     6563       +8     
- Misses       1967     1968       +1
Impacted Files Coverage Δ
superset/views/core.py 74.68% <80%> (+0.03%) ⬆️
superset/utils.py 88.06% <85.71%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eac97ce...7192327. Read the comment docs.

try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would negate the conditions here removing the need for the pass.

@timifasubaa timifasubaa force-pushed the ensure_csv_path_exists branch 2 times, most recently from d40d5b1 to 0f389a6 Compare April 16, 2018 18:31
@timifasubaa
Copy link
Contributor Author

@john-bodley Done

@timifasubaa timifasubaa force-pushed the ensure_csv_path_exists branch 2 times, most recently from d5277f8 to ce1eb3a Compare April 16, 2018 22:37
@john-bodley
Copy link
Member

@timifasubaa if you rebase your change the CI should succeed.

@timifasubaa
Copy link
Contributor Author

@john-bodley Succeeded. Ready for merge

@john-bodley john-bodley merged commit a14dc26 into apache:master Apr 18, 2018
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
timifasubaa added a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload a csv via gui points to non existing folder: '.../superset/app/static/uploads/data.csv'
4 participants