Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
MatBarba committed Sep 13, 2024
1 parent 339471b commit e2ed552
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/python/tests/core/compare_core_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

from ensembl.core.models import Base


def check_tables(session: Session, only_table: str = "") -> None:
success = []
errors = []
Expand All @@ -49,19 +50,20 @@ def check_tables(session: Session, only_table: str = "") -> None:
# Show the problematic query and continue
logging.warning(f"{table_name}: {err}")
errors.append(table_name)

logging.info(f"{len(success)} tables successfully queried with the ORM")
if errors:
logging.warning(f"{len(errors)} tables failed to be queried with the ORM: {", ".join(errors)}")
else:
logging.info("No errors found")


def main() -> None:
"""Main script entry-point."""
parser = ArgumentParser(
description=__doc__
parser = ArgumentParser(description=__doc__)
parser.add_argument(
"--url", required=True, type=str, help="MySQL URL to a core database to get tables data from"
)
parser.add_argument("--url", required=True, type=str, help="MySQL URL to a core database to get tables data from")
parser.add_argument("--table", type=str, help="Test this one table only")
parser.add_log_arguments(add_log_file=True)
args = parser.parse_args()
Expand All @@ -71,5 +73,6 @@ def main() -> None:
with dbc.session_scope() as session:
check_tables(session, only_table=args.table)


if __name__ == "__main__":
main()

0 comments on commit e2ed552

Please sign in to comment.