Fallback to databases in inspect-data.json when no -i options are passed#1031
Fallback to databases in inspect-data.json when no -i options are passed#1031frankier wants to merge 1 commit intosimonw:mainfrom
Conversation
Pass empty list of immutables from serve command as None
Codecov Report
@@ Coverage Diff @@
## main #1031 +/- ##
==========================================
- Coverage 84.63% 84.60% -0.03%
==========================================
Files 28 28
Lines 3892 3892
==========================================
- Hits 3294 3293 -1
- Misses 598 599 +1
Continue to review full report at Codecov.
|
|
I don't fully understand the bug you're fixing here. Could you provide a bit more explanation? |
|
The bug is that currently when there are databases passed in, but no -i flag, e.g. in configuration directory mode, inclusion in inspect-data.json does not automatically cause databases to be considered immutable, as described in the documentation. The reason is that the -i flag is specified multiple=True, which means when it is not passed in we will get an empty list [], rather than None. So the current code decides that no databases are immutable rather than falling back to inspect-data.json -- as is presumably intended. |
|
Please let me know if there's anything I can do to help get this merged. This is causing problems for me because it means when I build my Docker image my databases aren't considered immutable, which I would like them to be so that a download link is produced. |
|
This bug should have been fixed in #1229 - let me know if that's not the case! Thanks |
|
Sorry I didn't get to this PR sooner. I've joint-credited you in the release notes for this fix: https://docs.datasette.io/en/stable/changelog.html#v0-56 |
Currenlty
Datasette.__init__checks immutables against None to decide whether to fallback to inspect-data.json. This patch modifies the serve command to pass None when no -i options are passed so this fallback works correctly.