Skip to content

Commit

Permalink
Bugfix: The print_help message is truncated
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmcloaiza committed Jan 31, 2025
1 parent ec84423 commit bfd6a86
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions astroquery/eso/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ def timeout(self):
@staticmethod
def log_info(message):
"Wrapper for logging function"
log.info("%s", message)
log.info(message)

@staticmethod
def log_warning(message):
"Wrapper for logging function"
log.warning("%s", message)
log.warning(message)

Check warning on line 119 in astroquery/eso/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/eso/core.py#L119

Added line #L119 was not covered by tests

@staticmethod
def log_error(message):
"Wrapper for logging function"
log.error("%s", message)
log.error(message)

Check warning on line 124 in astroquery/eso/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/eso/core.py#L124

Added line #L124 was not covered by tests

@staticmethod
def log_debug(message):
"Wrapper for logging function"
log.debug("%s", message)
log.debug(message)

Check warning on line 129 in astroquery/eso/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/eso/core.py#L129

Added line #L129 was not covered by tests

@timeout.setter
def timeout(self, value):
Expand Down Expand Up @@ -326,12 +326,18 @@ def list_collections(self, *, cache=True) -> List[str]:
self._collections = list(res)
return self._collections

Check warning on line 327 in astroquery/eso/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/eso/core.py#L326-L327

Added lines #L326 - L327 were not covered by tests

def print_table_help(self, table_name):
def print_table_help(self, table_name: str) -> None:
"""
Prints the columns contained in a given table
"""
help_query = \

Check warning on line 333 in astroquery/eso/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/eso/core.py#L333

Added line #L333 was not covered by tests
f"select column_name, datatype from TAP_SCHEMA.columns where table_name = '{table_name}'"
h = self.query_tap_service(help_query)
self.log_info(f"Columns present in the table {table_name}: {h}")
return
available_cols = self.query_tap_service(help_query)
nlines = len(available_cols) + 2
n_ = astropy.conf.max_lines
astropy.conf.max_lines = nlines
self.log_info(f"\nColumns present in the table {table_name}:\n{available_cols}\n")
astropy.conf.max_lines = n_

Check warning on line 340 in astroquery/eso/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/eso/core.py#L335-L340

Added lines #L335 - L340 were not covered by tests

def _query_instrument_or_collection(self,
query_on: QueryOnField, primary_filter: Union[List[str], str], *,
Expand Down

0 comments on commit bfd6a86

Please sign in to comment.