Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #3

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading