astropy / astropy/astroquery

astroquery.cds.find_datasets result should respect the order of requested fields

Open
#1,589 0 comments 0 reactions 0 assignees View on GitHub
cds mocserver
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

When asking for a specific set of fields, the resulting Astropy table has a different ordering of the columns.

Example:

```python
ds = cds.find_datasets(meta_data ="*", fields=['ID', 'moc_access_url', 'hips_creation_date', 'hips_creator'])
ds.colnames
```
returns `['hips_creator', 'ID', 'moc_access_url', 'hips_creation_date']` whereas I was expecting to get the same order as what I asked in the fields parameter.

@bmatthieu3 : could you have a look?

Contributor guide

Open the contributing guide

Research direction

Start at the astroquery.cds.find_datasets entry point and reproduce the reported call with the requested fields. Trace how the Astropy table columns are assembled, then verify completion by confirming that ds.colnames exactly matches the order supplied in fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.