Skip to content

Commit

Permalink
st.spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-cnivera committed Oct 21, 2024
1 parent 938aaf4 commit fb47915
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions journeys/joins.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,24 @@ def joins_dialog() -> None:
)
)

if not left_table_object.primary_key.columns:
primary_keys = get_table_primary_keys(
get_snowflake_connection(),
table_fqn=fully_qualified_table_name(left_table_object.base_table),
)
left_table_object.primary_key.columns.extend(primary_keys or [""])
with st.spinner("Fetching primary keys..."):
if not left_table_object.primary_key.columns:
primary_keys = get_table_primary_keys(
get_snowflake_connection(),
table_fqn=fully_qualified_table_name(
left_table_object.base_table
),
)
left_table_object.primary_key.columns.extend(primary_keys or [""])

if not right_table_object.primary_key.columns:
primary_keys = get_table_primary_keys(
get_snowflake_connection(),
table_fqn=fully_qualified_table_name(right_table_object.base_table),
)
right_table_object.primary_key.columns.extend(primary_keys or [""])
if not right_table_object.primary_key.columns:
primary_keys = get_table_primary_keys(
get_snowflake_connection(),
table_fqn=fully_qualified_table_name(
right_table_object.base_table
),
)
right_table_object.primary_key.columns.extend(primary_keys or [""])

del st.session_state.semantic_model.relationships[:]
st.session_state.semantic_model.relationships.extend(
Expand Down

0 comments on commit fb47915

Please sign in to comment.