Skip to content

Commit

Permalink
trigger workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyaven committed Jul 17, 2024
1 parent 9cf032e commit 2791781
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ apikeys.ps1
stackql
stackql-zip
test.py
*.json
*.json
stackql-aws-cloud-shell.sh
stackql-azure-cloud-shell.sh
stackql-google-cloud-shell.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ docker compose down
To remove the image locally run:
```bash
docker rmi stackql-jupyter-demo-jupyter:latest
```
```
52 changes: 51 additions & 1 deletion notebooks/github/github.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,57 @@
"metadata": {},
"outputs": [],
"source": [
"# get commits by author"
"since = '2022-07-01T00:00:00Z'\n",
"until = '2023-06-30T23:59:59Z' "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%stackql\n",
"SELECT SUBSTR(DATE(JSON_EXTRACT(commit, '$$.author.date')),1,7) AS commit_month, count(*) AS num_commits\n",
"FROM github.repos.commits \n",
"WHERE since = '$since' and until = '$until'\n",
"and owner = '$owner' AND repo = 'stackql'\n",
"GROUP BY commit_month"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"pd.set_option('display.max_colwidth', None)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%stackql\n",
"SELECT \n",
"DATETIME(JSON_EXTRACT(commit, '$$.author.date'), '+11 hours') as commit_date,\n",
"CASE strftime('%w', DATETIME(JSON_EXTRACT(commit, '$$.author.date'), '+11 hours'))\n",
"WHEN '0' THEN 'Sunday'\n",
"WHEN '1' THEN 'Monday'\n",
"WHEN '2' THEN 'Tuesday'\n",
"WHEN '3' THEN 'Wednesday'\n",
"WHEN '4' THEN 'Thursday'\n",
"WHEN '5' THEN 'Friday'\n",
"WHEN '6' THEN 'Saturday'\n",
"END AS day_of_week,\n",
"JSON_EXTRACT(commit, '$$.message') as commit_message\n",
"FROM github.repos.commits \n",
"WHERE since = '2023-01-01T00:00:00Z' and until = '2023-01-31T23:59:59Z'\n",
"and owner = '$owner' AND repo = 'stackql'\n",
"ORDER BY commit_date ASC"
]
}
],
Expand Down

0 comments on commit 2791781

Please sign in to comment.