Skip to content

Commit

Permalink
Addresses comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Aug 9, 2024
1 parent 014a294 commit 8fe12f2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions superset/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@


def print_duration(start_time: float) -> None:
duration = time.time() - start_time
formatted_time = time.strftime("%H:%M:%S", time.gmtime(duration))
logger.info(f"Migration scripts completed. Duration: {formatted_time}")
logger.info(

Check warning on line 58 in superset/migrations/env.py

View check run for this annotation

Codecov / codecov/patch

superset/migrations/env.py#L57-L58

Added lines #L57 - L58 were not covered by tests
"Migration scripts completed. Duration: %s",
time.strftime("%H:%M:%S", time.gmtime(time.time() - start_time)),
)


def run_migrations_offline() -> None:
Expand All @@ -80,7 +81,7 @@ def run_migrations_offline() -> None:

with context.begin_transaction():
context.run_migrations()
print_duration(start_time)
print_duration(start_time)

Check warning on line 84 in superset/migrations/env.py

View check run for this annotation

Codecov / codecov/patch

superset/migrations/env.py#L84

Added line #L84 was not covered by tests


def run_migrations_online() -> None:
Expand Down Expand Up @@ -130,7 +131,7 @@ def process_revision_directives( # pylint: disable=redefined-outer-name, unused
try:
with context.begin_transaction():
context.run_migrations()
print_duration(start_time)
print_duration(start_time)

Check warning on line 134 in superset/migrations/env.py

View check run for this annotation

Codecov / codecov/patch

superset/migrations/env.py#L134

Added line #L134 was not covered by tests
finally:
connection.close()

Expand Down

0 comments on commit 8fe12f2

Please sign in to comment.