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
Implementation read/write of VOTable with Parquet serialization #15281
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.
|
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.
Welcome to Astropy 👋 and congratulations on your first pull request! 🎉
A project member will respond to you as soon as possible; in the meantime, please have a look over the Checklist for Contributed Code and make sure you've addressed as many of the questions there as possible.
If you feel that this pull request has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail feedback@astropy.org.
👋 Thank you for your draft pull request! Do you know that you can use |
83afeb3
to
952a3f4
Compare
pre-commit.ci autofix |
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.
Mostly minor comments in-line.
) | ||
|
||
# Open created VOTable with Parquet serialization | ||
votable = parse(filename) |
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.
The table write is done with the Table I/O registry but the read is done with the lower-level parse
instead.
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.
the parse
parses the VOTable correctly and creates a VOTable object. Reading the tables only also works with Table.read(filename). It adds the units correctly, but does not seem to have the other quantities as a VOTable object.
What would you suggest?
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.
I see, it is necessary to read the table back in as a VOTable to have access to the metadata. That justifies leaving the use of parse
as-is.
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.
Thank you @afaisst, this is coming along super nicely!
Some minor things are in inline comments. The big missing parts are:
- narrative docs, a changelog entry and a what's new.
- fixing the tests, I'll push some commits that do at least some of that
- adding an example file to the test data and use that in tests
pre-commit.ci autofix |
1 similar comment
pre-commit.ci autofix |
@pllim - we're at the point where pre-commit is more annoying than useful. It either should autofix or just be quiet |
You might have to rebase to pick up the RTD fix. FYI. |
36b8dbf
to
e9590b4
Compare
Hmm, CI was all good before the rebase 🤦♀️ |
e9590b4
to
3f76a7c
Compare
Failure on Windows looks like a path issue
|
d425aab
to
426722f
Compare
This is a reply to #15281 (comment) by @bsipocz
|
@eerovaher - thanks for pointing out, but I'm well aware. |
5e01191
to
3acb4d5
Compare
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.
Two additional suggestions came to mind as I'm working in this file
else: # in this case, there is no STREAM, hence no file linked. | ||
href = "" |
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 will cause an exception in the next line and therefore should be handled somehow.
in VOTables. | ||
""" | ||
# looks like votable already has a "Table" imported. | ||
from astropy.table import Table as Table2 |
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.
To avoid this awkward solution, I would suggest directly using the reader rather than via the convenience in Table.
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.
Nevermind, this wasn't a good idea as unlike ascii/votable/fits, as I see the parquet reader (and the others in misc) are not used directly even in their own tests. So I would leave this as is for now, and address is separately in the PR for #15358
3acb4d5
to
e3ebf1f
Compare
@pllim - Indeed, the issue comes down to the relative vs absolute patch in a |
Re: #15281 (comment) Should this be a separate bug fix PR then? |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…table rather to to code) and adding test data files
Updated index.rst (section "Data Serialization Formats") to include a bullet point about the new PARQUET serialization.
Added a section "VOTable now supports PARQUET serialization" with examples to present this new feature.
as nstarman recommended
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
b2b5450
to
12a9116
Compare
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 work, and the discussions and updates. It looks good to me now.
in io.votable so ResourceWarning does not pop up on Windows. This was added in astropy#15281
in io.votable so ResourceWarning does not pop up on Windows. This was added in astropy#15281
Description
This pull request is to address reading and writing of VOTables with Parquet serialization. Currently this functionality only exists for FITS. In this PR, we modify the read functionality of "astropy.io.votable.parse" to read VOTables with embedded link to an existing Parquet file. In addition, we add functionality to write VOTables serialized with Parquet files using the ".write()" functionality. In addition, a test function "test_read_write_votable_parquet()" in "table_test.py" is added.
cc @stargaser @bsipocz