Skip to content

Commit

Permalink
added issue templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyaven committed Oct 3, 2023
1 parent c8f24e0 commit 6f8f625
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 13 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG]'
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: enhancement
assignees: ''

---

**Feature Description**
A clear and concise description of what you want to happen.

**Example(s)**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Possible Approaches or Libraries to Consider**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Question
about: Pose a question to the StackQL team
title: "[QUESTION]"
labels: question
assignees: ''

---


## Question

This channel is an opportunity to ask ad-hoc questions to the `stackql` team. This channel is in lieu of an official platform for ongoing discussions and questions. Please ask your question :)

**Note**: Questions over github issues will be deprecated and retired once we settle on a platform / process ongoing.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ apikeys.sh
apikeys.ps1
stackql
stackql-zip
test.py
18 changes: 12 additions & 6 deletions extensions/stackql.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ def get_rendered_query(self, data):
return rendered

def run_query(self, query):
cur = conn.cursor(cursor_factory=RealDictCursor)
cur.execute(query)
rows = cur.fetchall()
cur.close()
json_str = json.dumps(rows)
return pd.read_json(StringIO(json_str))
try:
cur = conn.cursor(cursor_factory=RealDictCursor)
cur.execute(query)
rows = cur.fetchall()
cur.close()
json_str = json.dumps(rows)
return pd.read_json(StringIO(json_str))
except psycopg2.ProgrammingError as e:
if str(e) == "no results to fetch":
return []
else:
raise

@line_cell_magic
def stackql(self, line, cell=None):
Expand Down
45 changes: 41 additions & 4 deletions notebooks/aws/aws.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"metadata": {},
"outputs": [],
"source": [
"%load_ext ext.stackql"
"import sys\n",
"sys.path.append('/jupyter/ext')\n",
"import stackql\n",
"%load_ext stackql"
]
},
{
Expand Down Expand Up @@ -64,6 +67,43 @@
"_.plot(kind='pie', y='num_instances', labels=_['instanceType'], title='Instances by Type', autopct='%1.1f%%')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%stackql\n",
"CREATE MATERIALIZED VIEW vw_ec2_instance_types AS\n",
"SELECT \n",
"memoryInfo,\n",
"hypervisor,\n",
"autoRecoverySupported,\n",
"instanceType,\n",
"SPLIT_PART(processorInfo, '\\n', 3) as processorArch,\n",
"currentGeneration,\n",
"freeTierEligible,\n",
"hibernationSupported,\n",
"SPLIT_PART(vCpuInfo, '\\n', 2) as vCPUs,\n",
"bareMetal,\n",
"burstablePerformanceSupported,\n",
"dedicatedHostsSupported\n",
"FROM aws.ec2.instance_types\n",
"WHERE region = '$region'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# get multiple regions asynchronously\n",
"from pystackql import StackQL\n",
"stackql = StackQL()\n",
"stackql.executeStmt(\"REGISTRY PULL aws\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -73,11 +113,8 @@
"# get multiple regions asynchronously\n",
"import nest_asyncio, json\n",
"nest_asyncio.apply()\n",
"from pystackql import StackQL\n",
"import pandas as pd\n",
"\n",
"stackql = StackQL()\n",
"\n",
"regions = [\"ap-southeast-2\", \"us-east-1\"]\n",
"\n",
"queries = [\n",
Expand Down
9 changes: 6 additions & 3 deletions notebooks/github/github.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"metadata": {},
"outputs": [],
"source": [
"%load_ext ext.stackql"
"import sys\n",
"sys.path.append('/jupyter/ext')\n",
"import stackql\n",
"%load_ext stackql"
]
},
{
Expand All @@ -27,7 +30,7 @@
"%%stackql\n",
"SELECT *\n",
"FROM github.repos.contributors\n",
"where repo = 'stackql-playground' AND owner = '$owner'"
"where repo = 'stackql' AND owner = '$owner'"
]
},
{
Expand All @@ -49,7 +52,7 @@
"metadata": {},
"outputs": [],
"source": [
"_.plot(kind='bar', title='Commit History', x='commit_date', y='num_commits')"
"stackql_df.plot(kind='line', title='Commit History', x='commit_date', y='num_commits')"
]
}
],
Expand Down

0 comments on commit 6f8f625

Please sign in to comment.