What am I trying?
Type my query with subqueries into the first ui.textarea, get this data with the button replace subquery to cte
and get the correct data on the ui.label, but my problem is, with the query below, the data is not updating, it is the same what I put on the first textarea, what am I doing wrong here ????
def create() -> None:
@ui.page('/subquery_to_cte')
def page_subquery_to_cte():
with theme.frame('Page Subquery to CTE'):
message('Page Subquery to CTE')
username = ui.input(label='Query', placeholder='start typing').style(
'width: 1000px;')
ui.button('Replace Subquery to CTE',
on_click=lambda: replace_sub_to_cte())
label = ui.label().style(
'width: 1000px; height: 100px; word-wrap: break-word; weight: 100px;')
def replace_sub_to_cte():
label.text = subquery_to_cte(username.value)
internal_var = subquery_to_cte(username.value)
Expect result should be:
Original query -> Expected result
Thank you