Repository navigation
Update bundled datatables with current version (v7.0.x) - #17480
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
8d889ec to
fe20821
Compare
|
Note that the git pre-commit failure should be ignored. It warns that I added a large file > 300 kb - but there is nothing we can do about it, that's just the size of the external library that we bundle. |
|
You need to edit the astropy/.pre-commit-config.yaml Lines 9 to 14 in 4a55b10 |
fe20821 to
22409a4
Compare
22409a4 to
45573f0
Compare
|
I checked the display manually and for the tables that I tried it works. That's not surprising: The API changes in DataTables from version 1 to 2 are small and and we don't do any interactions with other code once it's displayed (editing cells, feeding back cell values into some other code), which is where the API changes are. |
45573f0 to
9e6e606
Compare
|
I have forgotten why astropy is bundling these libraries at all. Aren't the CDN versions sufficient? I'm hesitant to add nearly 0.5 Mb of churn to the astropy git repo for some large data files that only support a deprecated feature. |
|
OK, now I see the The other thing that is surprising me is that using |
|
For such a rarely used feature, perhaps we should consider changing the default of |
pllim
left a comment
There was a problem hiding this comment.
Thanks! Just some minor comments, otherwise LGTM.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Years ago, we decided to bundle DataTable (and jQuery that is depends on) with astropy. The sole purpose of this package is to display astropy table in the webbrowser and the js code was bundled to allow that functionality without being online. However, I now view this as a bug - we are not equipped to stay on top of potential js security and performance concerns. Online access is available nearly anywhere and talking to a number of users has shown that this feature is useful, but not absolutely essential for the rare offline work. Also, browsers cache libraries downloaded from a CDN, so people who use this feature frequently in fact will be able to use it offline, because their browsers will have cached the required js and css files already anyway. closes astropy#17480
|
pre-commit.ci autofix |
|
I guess the warning is working! But it needs to be handled. Also, does the text need updating?
Also no need for backticks in the message. |
|
I thought the Coco took the PR that will ignore |
|
"or removed" is not necessary? |
|
Not in 7.1, where we just ignore it, but I assume we'll remove it eventually so we want to give users a heads up that, if they modify their code anyway, that's what's going to happen at some point? |
In particular, this adds a more visible deprecation warning. Co-authored by: P. L. Lim <[email protected]>
ef6e99d to
7a95210
Compare
| self._use_local_files = use_local_files | ||
| if use_local_files: | ||
| warn( | ||
| "`use_local_files` is deprecated and will be ignored or removed in astropy 7.1.", |
There was a problem hiding this comment.
| "`use_local_files` is deprecated and will be ignored or removed in astropy 7.1.", | |
| "use_local_files is deprecated and will be ignored in astropy 7.1 and removed in the future.", |
| tmpfile, format="jsviewer", table_id="test", jskwargs={"use_local_files": True} | ||
| ) | ||
| with pytest.warns( | ||
| AstropyDeprecationWarning, match="`use_local_files` is deprecated" |
There was a problem hiding this comment.
| AstropyDeprecationWarning, match="`use_local_files` is deprecated" | |
| AstropyDeprecationWarning, match="use_local_files is deprecated" |
There was a problem hiding this comment.
Also need an additional change log about deprecating use_local_files ?
Technically not sure if we supposed to have "api" section in backport branch though... Hmm, where to put it?
pllim
left a comment
There was a problem hiding this comment.
LGTM, thanks! But I want to give Brigitta and Simon a chance to review. 🤞
|
pre-commit.ci autofix |
|
I lost track, what is the status with this one ? If it should go in 7.0.1, is it ready to go ? |
|
I did approve it. I think there was a concern about changing behavior in bugfix release but this is only an issue for a very niched use case, so I think the benefit outweighs the risk. So let's get it in! |
|
Ok let's do it then. |
Description
While we are deprecating the bundeled datatables (#16067) to avoid having to maintain js code, as long as we do we should update regularly to avoid any security holes that might exist in older code.
An alternative to this PR is #17521.
maintov7.0.x. GitHub couldn't do this automagically from the web UI.