Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ esa.euclid
product_type parameters dynamically. [#3601]
- In the method, ``get_scientific_product_list``, the ``dsr_part3`` parameter now supports the additional value
``latest``. [#3601]
- Removed unnecessary CAST(... AS text) from array columns in ``get_product_list``and
``__get_tile_catalogue_list``, as TAP 10.x now returns proper arrays. [#3599]
Comment on lines +67 to +68

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all enternal cleanup, so it doesn't need the changelog. I'll clean up the changelog file before release.



vizier
Expand Down
22 changes: 11 additions & 11 deletions astroquery/esa/euclid/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,10 +1017,10 @@ def __get_tile_catalogue_list(self, *, tile_index, product_type, verbose=False):
if product_type in conf.BASIC_DOWNLOAD_DATA_PRODUCTS:
query = (
f"SELECT basic_download_data.basic_download_data_oid, basic_download_data.product_type, "
f"basic_download_data.product_id, CAST(basic_download_data.observation_id_list as text) AS "
f"observation_id_list, CAST(basic_download_data.tile_index_list as text) AS tile_index_list, "
f"CAST(basic_download_data.patch_id_list as text) AS patch_id_list, "
f"CAST(basic_download_data.filter_name as text) AS filter_name, basic_download_data.release_name FROM "
f"basic_download_data.product_id, basic_download_data.observation_id_list AS "
f"observation_id_list, basic_download_data.tile_index_list AS tile_index_list, "
f"basic_download_data.patch_id_list AS patch_id_list, "
f"basic_download_data.filter_name AS filter_name, basic_download_data.release_name FROM "
f"sedm.basic_download_data WHERE '{tile_index}'=ANY(tile_index_list) AND product_type = '"
f"{product_type}' "
f"ORDER BY observation_id_list ASC;")
Expand All @@ -1038,7 +1038,7 @@ def __get_tile_catalogue_list(self, *, tile_index, product_type, verbose=False):
f"SELECT mer_segmentation_map.file_name, mer_segmentation_map.segmentation_map_oid, "
f"mer_segmentation_map.ra, mer_segmentation_map.dec, mer_segmentation_map.stc_s, "
f"mer_segmentation_map.tile_index, "
f"CAST(mer_segmentation_map.observation_id_list as TEXT) AS observation_id_list, "
f"mer_segmentation_map.observation_id_list AS observation_id_list, "
f"mer_segmentation_map.product_type, mer_segmentation_map.product_id FROM sedm.mer_segmentation_map "
f"WHERE mer_segmentation_map.tile_index = '{tile_index}' AND "
f"mer_segmentation_map.product_type = '{product_type}';")
Expand Down Expand Up @@ -1191,12 +1191,12 @@ def get_product_list(self, *, observation_id=None, tile_index=None, product_type
extra_condition = '' if dsr_condition is None else f'AND {dsr_condition}'

query = (
f"SELECT CAST(basic_download_data.file_name_list AS text) AS file_name_list, "
f"SELECT basic_download_data.file_name_list AS file_name_list, "
f"basic_download_data.basic_download_data_oid, basic_download_data.product_type, "
f"basic_download_data.product_id, CAST(basic_download_data.observation_id_list as text) AS "
f"observation_id_list, CAST(basic_download_data.tile_index_list as text) AS tile_index_list, "
f"CAST(basic_download_data.patch_id_list as text) AS patch_id_list, "
f"CAST(basic_download_data.filter_name as text) AS filter_name, basic_download_data.release_name, "
f"basic_download_data.product_id, basic_download_data.observation_id_list AS "
f"observation_id_list, basic_download_data.tile_index_list AS tile_index_list, "
f"basic_download_data.patch_id_list AS patch_id_list, "
f"basic_download_data.filter_name AS filter_name, basic_download_data.release_name, "
f"basic_download_data.{self.dsr_1}, basic_download_data.{self.dsr_2}, basic_download_data.{self.dsr_3} "
f"FROM {table} WHERE '{observation_id}'=ANY(observation_id_list) AND product_type = '"
f"{product_type}' {extra_condition}"
Expand All @@ -1218,7 +1218,7 @@ def get_product_list(self, *, observation_id=None, tile_index=None, product_type
f"mer_segmentation_map.{self.dsr_2}, mer_segmentation_map.{self.dsr_3} FROM {table} "
f"WHERE ( observation_id_list = '{observation_id}' OR observation_id_list like '{observation_id},"
f"%' OR observation_id_list "
f"like '%,{observation_id}' OR CAST(observation_id_list as TEXT) like '%,{observation_id},%' ) AND "
f"like '%,{observation_id}' OR observation_id_list like '%,{observation_id},%' ) AND "
f"mer_segmentation_map.product_type = '{product_type}' {extra_condition};")

if product_type in conf.RAW_FRAME_PRODUCTS:
Expand Down
Loading