-
-
Notifications
You must be signed in to change notification settings - Fork 337
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 deprecation warning for get_storage_class #669
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #669 +/- ##
==========================================
+ Coverage 86.58% 86.65% +0.06%
==========================================
Files 52 52
Lines 2102 2113 +11
==========================================
+ Hits 1820 1831 +11
Misses 282 282 ☔ View full report in Codecov by Sentry. |
1df6e8c
to
a4e96d5
Compare
9ab4904
to
7a68ca6
Compare
STORAGES = { | ||
'SILKY_STORAGE': { | ||
'BACKEND': 'path.to.StorageClass', | ||
}, | ||
# ... | ||
} |
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.
👍🏼
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.
Thanks for this PR! It's great to see that the deprecation warning for get_storage_class
being addressed in earnest.
I noticed that the PR introduces a forwards incompatibility by requiring a different configuration option (STORAGE) to be used instead of SILKY_STORAGE_CLASS
- a major change that will require users to update their configuration files.
I'm also curious about how the storages
class compares to the old get_storage_class
approach in terms of functionality and performance.
Overall, I think this is a good PR that addresses an important issue.
7a68ca6
to
f6bf1fa
Compare
The In terms of performance, comparing the new storages object against the get_storage_class implementation, it seems that the former would be more performant due to it caching storages. Since django-silk is initializing |
f6bf1fa
to
b24978d
Compare
Thanks for the explanation. Coming back to this in a few. |
This PR should fix the deprecation warning for
get_storage_class
by trying to import and use thestorages
class instead. However, the latter is not an exact replacement for the former, requiring a different configuration option to be provided under theSTORAGE
instead of theSILKY_STORAGE_CLASS
setting. This makes this PR a forwards incompatible change requiring a minor semver bump.Fixes #656