Skip to content

Commit

Permalink
Merge pull request #3 from luutuankiet/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
luutuankiet authored Feb 19, 2024
2 parents 4de463a + 6178d87 commit a88f76b
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 1,068 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ __pycache__/
*.pyc
*.pyo
*.pyd

*.ipynb
141 changes: 0 additions & 141 deletions app/charts/main.ipynb

This file was deleted.

45 changes: 20 additions & 25 deletions app/charts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
import duckdb
import os
from helper.source_env import dbt_models_path
from helper.source_env import dbt_project_dir

motherduck_token = os.environ.get("motherduck_token")
con = duckdb.connect(f'md:ticktick_gtd?motherduck_token={motherduck_token}')
Expand Down Expand Up @@ -54,34 +54,29 @@ def highlight_row(row):
st.write("## count of clarified and next action")


analytics_path = os.path.join(dbt_models_path,'analytics')
analytics_path = os.path.join(dbt_project_dir,'analyses')
tags_count_path = os.path.join(analytics_path,'active_tags_count.sql')


with open(tags_count_path,'r') as f:
query = f.read()
tags_count = cur.sql(query).df()

st.dataframe(
tags_count,
column_config={
"weight_clarifyme": st.column_config.ProgressColumn(
"weight_clarifyme",
format="%f",
min_value=0,
max_value=100
),
"weight_next_action": st.column_config.ProgressColumn(
"weight_next_action",
format="%f",
min_value=0,
max_value=100
)
},
query = lambda: open(tags_count_path, 'r').read()
tags_count = cur.sql(query()).df()
colored_tags_count = tags_count.style.map(highlight_text,subset=['clarification_progress'])
tags_count_final = colored_tags_count

st.dataframe(
tags_count_final,
column_config={
"clarification_progress": st.column_config.ProgressColumn(
"clarification_progress",
format="%f",
min_value=0,
max_value=100
),
},

hide_index=True,
use_container_width=True
)
hide_index=True,
use_container_width=True
)



Expand Down
147 changes: 0 additions & 147 deletions app/get_all_tasks.ipynb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ WHERE
)
)

select
select
cast(
(cnt_clarifyme* 100 / (cnt_clarifyme + cnt_none + cnt_context)) as decimal(10,2)
) as weight_clarifyme,
cnt_clarifyme,
cast((
(cnt_none+cnt_context)* 100 / (cnt_clarifyme + cnt_none + cnt_context)) as decimal(10,2)) as weight_next_action,
(cnt_none+cnt_context) as cnt_next_action,
100 - (cnt_clarifyme* 100 / (cnt_clarifyme + cnt_none + cnt_context)) as decimal(10,2)
) as clarification_progress,
cnt_clarifyme::int,
(cnt_none+cnt_context)::int as cnt_next_action,

from source
Loading

0 comments on commit a88f76b

Please sign in to comment.