Skip to content

Commit 2791781

Browse files
committed
trigger workflow
1 parent 9cf032e commit 2791781

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ apikeys.ps1
55
stackql
66
stackql-zip
77
test.py
8-
*.json
8+
*.json
9+
stackql-aws-cloud-shell.sh
10+
stackql-azure-cloud-shell.sh
11+
stackql-google-cloud-shell.sh

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ docker compose down
154154
To remove the image locally run:
155155
```bash
156156
docker rmi stackql-jupyter-demo-jupyter:latest
157-
```
157+
```

notebooks/github/github.ipynb

+51-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,57 @@
5858
"metadata": {},
5959
"outputs": [],
6060
"source": [
61-
"# get commits by author"
61+
"since = '2022-07-01T00:00:00Z'\n",
62+
"until = '2023-06-30T23:59:59Z' "
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": null,
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"%%stackql\n",
72+
"SELECT SUBSTR(DATE(JSON_EXTRACT(commit, '$$.author.date')),1,7) AS commit_month, count(*) AS num_commits\n",
73+
"FROM github.repos.commits \n",
74+
"WHERE since = '$since' and until = '$until'\n",
75+
"and owner = '$owner' AND repo = 'stackql'\n",
76+
"GROUP BY commit_month"
77+
]
78+
},
79+
{
80+
"cell_type": "code",
81+
"execution_count": null,
82+
"metadata": {},
83+
"outputs": [],
84+
"source": [
85+
"import pandas as pd\n",
86+
"pd.set_option('display.max_colwidth', None)\n"
87+
]
88+
},
89+
{
90+
"cell_type": "code",
91+
"execution_count": null,
92+
"metadata": {},
93+
"outputs": [],
94+
"source": [
95+
"%%stackql\n",
96+
"SELECT \n",
97+
"DATETIME(JSON_EXTRACT(commit, '$$.author.date'), '+11 hours') as commit_date,\n",
98+
"CASE strftime('%w', DATETIME(JSON_EXTRACT(commit, '$$.author.date'), '+11 hours'))\n",
99+
"WHEN '0' THEN 'Sunday'\n",
100+
"WHEN '1' THEN 'Monday'\n",
101+
"WHEN '2' THEN 'Tuesday'\n",
102+
"WHEN '3' THEN 'Wednesday'\n",
103+
"WHEN '4' THEN 'Thursday'\n",
104+
"WHEN '5' THEN 'Friday'\n",
105+
"WHEN '6' THEN 'Saturday'\n",
106+
"END AS day_of_week,\n",
107+
"JSON_EXTRACT(commit, '$$.message') as commit_message\n",
108+
"FROM github.repos.commits \n",
109+
"WHERE since = '2023-01-01T00:00:00Z' and until = '2023-01-31T23:59:59Z'\n",
110+
"and owner = '$owner' AND repo = 'stackql'\n",
111+
"ORDER BY commit_date ASC"
62112
]
63113
}
64114
],

0 commit comments

Comments
 (0)