question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider deprecating and then removing the io.ascii Column.dtype attribute

See original GitHub issue

Description

In #11892 there was discussion (and at one point code) to deprecate the io.ascii.core.Column.dtype attribute, with a plan to remove it. This issue is created to continue that discussion separately from that PR.

I am not in favor of this because it removes the possibility of user-defined readers specifying the exact dtype of columns without writing their own _convert_vals method in a custom Outputter. Such readers might already exist in the wild.

Readers like CDS and Rdb currently use Column.type to specify generic types such as float, int, str, but that mechanism does not allow fine-grained control like np.int8. Before the overhaul of ECSV in v4.3 of astropy, the ECSV reader did use the Column.dtype to do exactly that.

Io.ascii has been out for about 10 years now and has always been advertised as an extensible reader (though dtype came later, probably with ECSV). So we should not take this API change lightly as if it were just an internal change.

Additional context

#11892

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hamogucommented, Jun 27, 2021

OK, if we have a test and @taldcroft has a use case (even if that’s not currently used), then we don’t remove it. It’s in there, it’s not broken and removing it won’t actually save us work right now. In contrast, it would be extra work right now - with the uncertain promise of saving work later.

So, I vote to close this and leave the attribute in.

0reactions
mhvkcommented, Jun 27, 2021

OK, sounds like it is the path of at least adding a test!

Read more comments on GitHub >

github_iconTop Results From Across the Web

fits.io fails to write numpy structured arrays with unicode ...
So is astropy.io.fits.writeto() officially deprecated? ... create a FITS table directly from a numpy array should be deprecated and removed.
Read more >
IO tools (text, CSV, HDF5, …) — pandas 1.5.2 documentation
If the parsed data only contains one column then return a Series . Deprecated since version 1.4.0: Append .squeeze("columns") to the call to...
Read more >
Reading Tables — Astropy v5.2
ASCII data tables can contain bad or missing values. A common case is when a table contains blank entries with no available data....
Read more >
apache_beam.dataframe.io module
N', rather than 'X'…'X'. Passing in False will cause data to be overwritten if there are duplicate names in the columns. dtype (Type...
Read more >
ALTER TABLE | CQL for Cassandra 3.0
Change column data type to a compatible type. Note: Cassandra does not support changing the type of collections (lists, sets and maps) and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found