Skip to content

Commit

Permalink
Kill stray tqdms when starting up dagster (#11658)
Browse files Browse the repository at this point in the history
Summary:
These produce an unsightly "0it [00:00, ?it/s]" in the console output
every time you start up dagit with no dagster home set.

Test Plan: Run dagit without DAGSTER_HOME set

### Summary & Motivation

### How I Tested These Changes
  • Loading branch information
gibsondan committed Jan 12, 2023
1 parent 4e3e71d commit 0fbe38b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def add_selector_id_to_jobs_table(storage, print_fn=None):
).order_by(JobTable.c.id.asc())
).fetchall()

for row_id, state_str, create_timestamp, update_timestamp in tqdm(rows):
rows_progress = tqdm(rows) if print_fn else rows

for row_id, state_str, create_timestamp, update_timestamp in rows_progress:
state = deserialize_as(state_str, InstigatorState)
selector_id = state.selector_id

Expand Down Expand Up @@ -90,7 +92,10 @@ def add_selector_id_to_ticks_table(storage, print_fn=None):
print_fn("Querying storage.")

instigator_states = storage.all_instigator_state()
for state in tqdm(instigator_states):

states = tqdm(instigator_states) if print_fn else instigator_states

for state in states:
with storage.connect() as conn:
conn.execute(
JobTickTable.update() # pylint: disable=no-value-for-parameter
Expand Down

0 comments on commit 0fbe38b

Please sign in to comment.