-
-
Notifications
You must be signed in to change notification settings - Fork 420
Bugfix: ALMA enhanced tables don't need qtable #3395
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,7 +220,7 @@ def get_enhanced_table(result): | |
"Please refer to https://astropy-regions.readthedocs.io/en/latest/installation.html for how to install it.") | ||
raise | ||
|
||
def _parse_stcs_string(input): | ||
def s_region_parser(input): | ||
csys = 'icrs' | ||
|
||
def _get_region(tokens): | ||
|
@@ -293,19 +293,10 @@ def _get_region(tokens): | |
return result | ||
else: | ||
return _get_region(s_region.split()) | ||
prep_table = result.to_qtable() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not at all sure why this stopped working, we haven't really switch the API (as we haven't really switched out the TAP results to return Tables rather than DAL result tables as suggested #3244) |
||
s_region_parser = None | ||
for field in result.resultstable.fields: | ||
if ('s_region' == field.ID) and \ | ||
('obscore:Char.SpatialAxis.Coverage.Support.Area' == field.utype): | ||
if 'adql:REGION' == field.xtype: | ||
s_region_parser = _parse_stcs_string | ||
# this is where to add other xtype parsers such as shape | ||
break | ||
if (s_region_parser): | ||
for row in prep_table: | ||
row['s_region'] = s_region_parser(row['s_region']) | ||
return prep_table | ||
|
||
for row in result: | ||
row['s_region'] = s_region_parser(row['s_region']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't reuse/call the method inside its body |
||
return result | ||
|
||
|
||
class AlmaAuth(BaseVOQuery, BaseQuery): | ||
|
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 would leave this as a private method