Skip to content

Commit

Permalink
Desktop primary key bugfix
Browse files Browse the repository at this point in the history
- function on button click used variables from outer scope, replaced with parameters
lbellmann committed Jul 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6ad085c commit af1c7c4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions frontend/GraphXplore/pages/2_Data_Transformation.py
Original file line number Diff line number Diff line change
@@ -511,11 +511,12 @@ def get_overview_widget(parent_obj, curr_mapping: DataMapping):
target_pk_table = target_name_col.text_input('Insert name of result CSV table', table_name)
result_data = VariableHandle(ADD_PK_RESULT_DATA_KEY, init={}).get_attr()

def add_pk():
result_data.clear()
DataMappingUtils.add_primary_key(source_data, table_name,
result_data, target_pk_table, pk_name, start_idx)
st.button('Generate new table', type='primary', on_click=add_pk)
def add_pk(data_source, data_result, data_table, pk_to_add, pk_start_idx):
data_result.clear()
DataMappingUtils.add_primary_key(
data_source, data_table, data_result, target_pk_table, pk_to_add, pk_start_idx)
st.button('Generate new table', type='primary', on_click=add_pk,
args=[source_data, result_data, table_name, pk_name, start_idx])

if len(result_data) > 0:
pk_add_data_downloader = CSVDownloader(ADD_PK_RESULT_DATA_KEY, 'Store generated table',

0 comments on commit af1c7c4

Please sign in to comment.