From 46bbc1cf0f4201564bb9f8d3c015e2d214db398b Mon Sep 17 00:00:00 2001 From: Alsia Plybeah Date: Mon, 1 Jul 2024 17:00:21 -0400 Subject: [PATCH] Add Logging to Sprint import (#130) ## Summary Fixes #110 ### Time to review: __1 mins__ ## Changes proposed * added info level logging statement to the `db_import` command ## Context for reviewers _Terminal_ Screen Shot 2024-07-01 at 4 35 44 PM _Database_ Screen Shot 2024-07-01 at 4 35 56 PM ## Additional information > Screenshots, GIF demos, code examples or output to help show the changes working as expected. --- analytics/src/analytics/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/analytics/src/analytics/cli.py b/analytics/src/analytics/cli.py index 20540a914..60b482160 100644 --- a/analytics/src/analytics/cli.py +++ b/analytics/src/analytics/cli.py @@ -157,6 +157,8 @@ def export_json_to_database( issue_file: Annotated[str, ISSUE_FILE_ARG], ) -> None: """Import JSON data to the database.""" + logger.info("Beginning import") + # Get the database engine and establish a connection engine = db.get_db() @@ -183,6 +185,8 @@ def export_json_to_database( engine=engine, replace_table=True, ) + rows = len(sprint_data.to_dict()) + logger.info("Number of rows in table: %s", rows) @metrics_app.command(name="deliverable_percent_complete")