-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
fix: allow datasource imports on Windows #22264
Conversation
No sources are added when importing zip files on Windows, as file paths are parsed using `pathlib.PureWindowsPath`. Schemas are defined using prefixes with trailing slashes, therefore file paths in zipfiles should instead be treated as `pathlib.PurePosixPath`s. Although Superset does not have official Windows support, this change fixes imports without changing the behaviour on Unix, since instantiating `pathlib.Path` creates a `pathlib.PurePosixPath`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️
We hope to see you in our Slack community too!
Thank you for the contribution! You're right, that while we don't support Windows, it never hurts to improve the experience for those who wish to go down that road. I'm pinging @betodealmeida and @eschutho for review since they're close to the feature, but also pinging @jinghua-qa in case there are any concerns with supporting this from a QA standpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks! And #til!
Codecov Report
@@ Coverage Diff @@
## master #22264 +/- ##
==========================================
+ Coverage 65.54% 66.84% +1.29%
==========================================
Files 1841 1841
Lines 70220 70220
Branches 7670 7670
==========================================
+ Hits 46027 46936 +909
+ Misses 22211 21302 -909
Partials 1982 1982
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
SUMMARY
No sources are added when importing zip files on Windows, as file paths are parsed using
pathlib.PureWindowsPath
. Schemas are defined using prefixes with trailing slashes, therefore file paths in zipfiles should instead be treated aspathlib.PurePosixPath
s.Although Superset does not have official Windows support, this change fixes imports without changing the behaviour on Unix, since instantiating
pathlib.Path
creates apathlib.PurePosixPath
.TESTING INSTRUCTIONS
Import zipfile (e.g.
superset import_dashboards -p dashboard_export.zip
) on WIndows