Repository navigation
Conversation
| assert table is not None | ||
|
|
||
| tt = table.to_table() | ||
| assert tt['access_url'][0] == ( |
There was a problem hiding this comment.
Currently, without this patch, it returns a b'http://...'.
|
|
||
| field_types = [ | ||
| ('string_test', {'datatype': 'char', 'arraysize': '*'}), | ||
| ('string_test', {'datatype': 'unicodeChar', 'arraysize': '*'}), |
There was a problem hiding this comment.
Behavior change in existing test.
taldcroft
left a comment
There was a problem hiding this comment.
This also needs dedicated table tests in test_column.py to test the change. The potential breakage extends to users that are putting bytes objects into a column, e.g. like c = Column([b'asdf', None]) and then expecting c[0] to be bytes.
| astropy.table | ||
| ^^^^^^^^^^^^^ | ||
|
|
||
| - Accessing variable length columns from VO table no longer returns bytes |
There was a problem hiding this comment.
This should be in the API changes section. The more fundamental change is to the table item access behavior of a Column of object dtype whenever the object is bytes. So in fact the VO table does still return a column of bytes objects, but it looks like str whenever they get accessed.
There was a problem hiding this comment.
Okay, I solidified the change log entry.
Codecov Report
@@ Coverage Diff @@
## master #8745 +/- ##
==========================================
- Coverage 86.96% 86.94% -0.02%
==========================================
Files 408 399 -9
Lines 61437 59355 -2082
Branches 1096 1100 +4
==========================================
- Hits 53429 51607 -1822
+ Misses 7385 7107 -278
- Partials 623 641 +18
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
but surely having a decision by 4.0 is feasible? |
|
I have locally rebased this on master and changed the Cython code update to below, and see tests passing for Table and io.votable: With this new flow, I don't see any performance change for I confirmed that there is an API change for table access to an Object column that has a Python Takeaway: this is good from my perspective for Table, but would definitely need an API changelog entry. |
|
Re: #8745 (comment) @taldcroft , regarding the code change that you posted above -- Do you want me to actually change it to that logic or was it just for your personal testing? I am not sure what you mean by "it never gets to the Hope you can clarify! p.s. I updated the change log and will push it out shortly. |
74c2f06 to
2196ad0
Compare
2196ad0 to
b050025
Compare
Add Column test as @taldcroft suggested.
b050025 to
3e75def
Compare
| assert c[1] == 'def' # Was b'def' before PR 8745 | ||
| assert isinstance(c[1], str) # Was bytes before PR 8745 | ||
| assert not isinstance(c[1], bytes) # Was str before PR 8745 |
There was a problem hiding this comment.
I noted the behavior change in comments here when compared to astropy 3.2.2. Is this behavior change acceptable?
| assert np.all(c[:2] == np.array([None, b'def'])) | ||
| assert not np.all(c[:2] == np.array([None, 'def'])) |
There was a problem hiding this comment.
Comparison to np.array remains unchanged, unlike above.
I did want you to change it to maintain table performance. Yesterday I thought I found a noticeable hit on column access speed with the `isinstance() in there up front. But trying to reproduce today I don't see it. E.g.: or Can you verify that the timing in this branch compared to master is the same? I'm surprised / confused because it has to do the If there is no noticeable performance difference then I agree avoiding the
Sorry, I just meant for normal Table column access of some type like float or int. |
|
This change has a side effect on write() that FIELDs with string values now default to an IVOA datatype of "unicodeChar" instead of "char". This change was noted and accounted for in the unit tests, but it turns out it is not benign. The output() method of the UnicodeChar converter is different than that for Char. One impact of this is that when a VOTable with a char FIELD is read, then written, the FIELD is output as a unicodeChar with it original value wrapped by b''. So when input is: the output is:
With this complication, and the lingering concerns about performance and Table impacts beyond VOTable reading, @pllim and I decided we should table this for 4.0 and revisit it for 4.1. |
|
Trying to see if we can do this without touching the |
|
Closing in favor of #9505 . If we want to come back to this solution, I'd rather open a new PR. |
Fix #8716 . This does change a subtle behavior, so it should only go into a major release.
I suspect it would affect packages downstream, e.g.,
astroquery.vo_conesearchor whoever is parsing VO table usingTable.read()and then decoding bytes to UTF-8 themselves.Fun fact: Incidentally, I have just tagged all four Toms for review!
TODO: