1+ {
2+ "cells" : [
3+ {
4+ "cell_type" : " markdown" ,
5+ "metadata" : {},
6+ "source" : [
7+ " # PyStackQL Development Demo\n " ,
8+ " \n " ,
9+ " This notebook demonstrates how to use the development version of PyStackQL directly from the source code. Any changes you make to the PyStackQL code will be immediately reflected here."
10+ ]
11+ },
12+ {
13+ "cell_type" : " code" ,
14+ "execution_count" : null ,
15+ "metadata" : {},
16+ "outputs" : [],
17+ "source" : [
18+ " # First, let's check what version of PyStackQL we're using\n " ,
19+ " import pystackql\n " ,
20+ " print(f\" PyStackQL Version: {pystackql.__version__}\" )\n " ,
21+ " \n " ,
22+ " # Check the location of the package to confirm we're using the development version\n " ,
23+ " print(f\" Package Location: {pystackql.__file__}\" )"
24+ ]
25+ },
26+ {
27+ "cell_type" : " code" ,
28+ "execution_count" : null ,
29+ "metadata" : {},
30+ "outputs" : [],
31+ "source" : [
32+ " # Load the magic extension\n " ,
33+ " %load_ext pystackql.magic"
34+ ]
35+ },
36+ {
37+ "cell_type" : " markdown" ,
38+ "metadata" : {},
39+ "source" : [
40+ " ## Basic Query Test\n " ,
41+ " \n " ,
42+ " Let's run a simple query to test that everything is working:"
43+ ]
44+ },
45+ {
46+ "cell_type" : " code" ,
47+ "execution_count" : null ,
48+ "metadata" : {},
49+ "outputs" : [],
50+ "source" : [
51+ " %stackql SELECT 42 as answer"
52+ ]
53+ },
54+ {
55+ "cell_type" : " markdown" ,
56+ "metadata" : {},
57+ "source" : [
58+ " ## CSV Download Test\n " ,
59+ " \n " ,
60+ " Let's test the CSV download functionality:"
61+ ]
62+ },
63+ {
64+ "cell_type" : " code" ,
65+ "execution_count" : null ,
66+ "metadata" : {},
67+ "outputs" : [],
68+ "source" : [
69+ " %%stackql --csv-download\n " ,
70+ " SELECT \n " ,
71+ " 'Python' as language,\n " ,
72+ " 'Development' as mode,\n " ,
73+ " 'PyStackQL' as package"
74+ ]
75+ },
76+ {
77+ "cell_type" : " markdown" ,
78+ "metadata" : {},
79+ "source" : [
80+ " ## Test Cloud Provider Functionality\n " ,
81+ " \n " ,
82+ " If you have credentials configured, you can test actual cloud provider queries:"
83+ ]
84+ },
85+ {
86+ "cell_type" : " code" ,
87+ "execution_count" : null ,
88+ "metadata" : {},
89+ "outputs" : [],
90+ "source" : [
91+ " # Uncomment and run the appropriate provider query based on your available credentials\n " ,
92+ " \n " ,
93+ " # AWS Example\n " ,
94+ " # %stackql DESCRIBE aws.ec2.instances\n " ,
95+ " \n " ,
96+ " # GitHub Example\n " ,
97+ " # %stackql registry pull github\n " ,
98+ " # %stackql SELECT login FROM github.users.followers WHERE username = 'stackql'"
99+ ]
100+ },
101+ {
102+ "cell_type" : " markdown" ,
103+ "metadata" : {},
104+ "source" : [
105+ " ## Development Tips\n " ,
106+ " \n " ,
107+ " 1. After modifying PyStackQL code, you don't need to reinstall the package - changes are reflected immediately\n " ,
108+ " 2. You can run tests from the terminal with `pytest tests/`\n " ,
109+ " 3. If you modify deep core functionality, you may need to restart the kernel\n " ,
110+ " 4. To debug issues, you can use Python's built-in debugging tools:"
111+ ]
112+ },
113+ {
114+ "cell_type" : " code" ,
115+ "execution_count" : null ,
116+ "metadata" : {},
117+ "outputs" : [],
118+ "source" : [
119+ " # Example debugging a PyStackQL function\n " ,
120+ " from pystackql.core import StackQL\n " ,
121+ " \n " ,
122+ " # Get instance properties\n " ,
123+ " stackql = StackQL()\n " ,
124+ " props = stackql.properties()\n " ,
125+ " print(props)"
126+ ]
127+ }
128+ ],
129+ "metadata" : {
130+ "kernelspec" : {
131+ "display_name" : " Python (PyStackQL Dev)" ,
132+ "language" : " python" ,
133+ "name" : " pystackql-dev"
134+ },
135+ "language_info" : {
136+ "codemirror_mode" : {
137+ "name" : " ipython" ,
138+ "version" : 3
139+ },
140+ "file_extension" : " .py" ,
141+ "mimetype" : " text/x-python" ,
142+ "name" : " python" ,
143+ "nbconvert_exporter" : " python" ,
144+ "pygments_lexer" : " ipython3" ,
145+ "version" : " 3.10.4"
146+ }
147+ },
148+ "nbformat" : 4 ,
149+ "nbformat_minor" : 4
150+ }
0 commit comments