jupyter-duckdb 1.2.102__tar.gz → 1.2.103__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/PKG-INFO +13 -12
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/README.md +11 -10
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/setup.py +1 -1
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Connection.py +3 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/duckdb/Connection.py +3 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/postgres/Connection.py +4 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/sqlite/Connection.py +3 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/kernel.py +187 -166
- jupyter_duckdb-1.2.103/src/duckdb_kernel/magics/MagicCommandCallback.py +24 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/MagicCommandHandler.py +9 -9
- jupyter_duckdb-1.2.103/src/duckdb_kernel/magics/MagicState.py +11 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/__init__.py +1 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/PKG-INFO +13 -12
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/SOURCES.txt +1 -1
- jupyter_duckdb-1.2.102/src/duckdb_kernel/magics/MagicCommandCallback.py +0 -31
- jupyter_duckdb-1.2.102/src/duckdb_kernel/magics/StringWrapper.py +0 -3
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/setup.cfg +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/__main__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Column.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Constraint.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/DatabaseError.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/ForeignKey.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Table.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/error/EmptyResultError.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/error/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/duckdb/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/postgres/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/postgres/util.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/sqlite/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/kernel.json +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/MagicCommand.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/MagicCommandException.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/DCParser.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/LogicParser.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/ParserError.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/RAParser.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/DCOperand.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/LogicElement.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/LogicOperand.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/LogicOperator.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RABinaryOperator.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAElement.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAOperand.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAOperator.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAUnaryOperator.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Add.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/And.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/ArrowLeft.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/ConditionalSet.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Cross.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Difference.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Divide.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Division.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Equal.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/FullOuterJoin.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/GreaterThan.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/GreaterThanEqual.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Intersection.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Join.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/LeftOuterJoin.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/LessThan.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/LessThanEqual.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Minus.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Multiply.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Or.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/RightOuterJoin.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Unequal.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Union.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Not.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Projection.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Rename.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Selection.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/tokenizer/Token.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/tokenizer/Tokenizer.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/tokenizer/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/util/RenamableColumn.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/util/RenamableColumnList.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/util/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_dc.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_ra.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_result_comparison.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_sql.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/ResultSetComparator.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/SQL.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/TestError.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/formatting.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/Drawer.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/Plotly.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/RATreeDrawer.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/SchemaDrawer.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/__init__.py +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/plotly-3.0.1.min.js +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/ra.css +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/ra.js +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/dependency_links.txt +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/requires.txt +0 -0
- {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jupyter-duckdb
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.103
|
|
4
4
|
Summary: a basic wrapper kernel for DuckDB
|
|
5
5
|
Home-page: https://github.com/erictroebs/jupyter-duckdb
|
|
6
6
|
Author: Eric Tröbs
|
|
@@ -118,23 +118,24 @@ another DuckDB file or a file with SQL statements. In the first case the
|
|
|
118
118
|
included tables will be copied to the new database, while in the second case the
|
|
119
119
|
SQL statements are just executed. We find this feature very useful to work in a
|
|
120
120
|
temporary copy of the data and therefore be able to restart at any time. The
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
optional parameter `NAME` may be used to name a connection and reference it
|
|
122
|
+
later by using the magic command `USE`.
|
|
123
123
|
|
|
124
124
|
```
|
|
125
125
|
%CREATE data.duckdb OF my_statements.sql
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
`LOAD` on the other hand loads an existing database and returns an error if it
|
|
129
|
-
does not exist. (That is why `OF` cannot be used with `LOAD`! `
|
|
130
|
-
|
|
129
|
+
does not exist. (That is why `OF` cannot be used with `LOAD`! `NAME` on the
|
|
130
|
+
other hand is available also with this magic command.)
|
|
131
131
|
|
|
132
132
|
```
|
|
133
133
|
%LOAD data.duckdb
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
loaded, the current one is closed first and saved to disk
|
|
136
|
+
Multiple databases can be open at any time. If a new database with the same
|
|
137
|
+
name is created or loaded, the current one is closed first and saved to disk
|
|
138
|
+
if necessary.
|
|
138
139
|
|
|
139
140
|
Please note that `:memory:` is also a valid file path for DuckDB. The data is
|
|
140
141
|
then stored exclusively in the main memory. In combination with `CREATE`
|
|
@@ -213,10 +214,10 @@ FROM bar
|
|
|
213
214
|
|
|
214
215
|
### Ship Tests With Your Notebooks
|
|
215
216
|
|
|
216
|
-
Simple tests can be loaded
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
Simple tests can be loaded from json files with the help of magic command
|
|
218
|
+
`LOAD_TESTS`. These tests are stored as a JSON file. Each test is assigned a
|
|
219
|
+
unique name, a result set and whether the test should check the order of the
|
|
220
|
+
result. A very simple test file looks like the following JSON object:
|
|
220
221
|
|
|
221
222
|
```json
|
|
222
223
|
{
|
|
@@ -90,23 +90,24 @@ another DuckDB file or a file with SQL statements. In the first case the
|
|
|
90
90
|
included tables will be copied to the new database, while in the second case the
|
|
91
91
|
SQL statements are just executed. We find this feature very useful to work in a
|
|
92
92
|
temporary copy of the data and therefore be able to restart at any time. The
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
optional parameter `NAME` may be used to name a connection and reference it
|
|
94
|
+
later by using the magic command `USE`.
|
|
95
95
|
|
|
96
96
|
```
|
|
97
97
|
%CREATE data.duckdb OF my_statements.sql
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
`LOAD` on the other hand loads an existing database and returns an error if it
|
|
101
|
-
does not exist. (That is why `OF` cannot be used with `LOAD`! `
|
|
102
|
-
|
|
101
|
+
does not exist. (That is why `OF` cannot be used with `LOAD`! `NAME` on the
|
|
102
|
+
other hand is available also with this magic command.)
|
|
103
103
|
|
|
104
104
|
```
|
|
105
105
|
%LOAD data.duckdb
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
loaded, the current one is closed first and saved to disk
|
|
108
|
+
Multiple databases can be open at any time. If a new database with the same
|
|
109
|
+
name is created or loaded, the current one is closed first and saved to disk
|
|
110
|
+
if necessary.
|
|
110
111
|
|
|
111
112
|
Please note that `:memory:` is also a valid file path for DuckDB. The data is
|
|
112
113
|
then stored exclusively in the main memory. In combination with `CREATE`
|
|
@@ -185,10 +186,10 @@ FROM bar
|
|
|
185
186
|
|
|
186
187
|
### Ship Tests With Your Notebooks
|
|
187
188
|
|
|
188
|
-
Simple tests can be loaded
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
Simple tests can be loaded from json files with the help of magic command
|
|
190
|
+
`LOAD_TESTS`. These tests are stored as a JSON file. Each test is assigned a
|
|
191
|
+
unique name, a result set and whether the test should check the order of the
|
|
192
|
+
result. A very simple test file looks like the following JSON object:
|
|
192
193
|
|
|
193
194
|
```json
|
|
194
195
|
{
|
|
@@ -19,6 +19,7 @@ class Connection(Base):
|
|
|
19
19
|
self.host: str = host
|
|
20
20
|
self.port: int = port
|
|
21
21
|
self.username: Optional[str] = username
|
|
22
|
+
self.password: Optional[str] = password
|
|
22
23
|
|
|
23
24
|
options = {
|
|
24
25
|
'host': host,
|
|
@@ -43,6 +44,9 @@ class Connection(Base):
|
|
|
43
44
|
def close(self):
|
|
44
45
|
self.con.close()
|
|
45
46
|
|
|
47
|
+
def copy(self) -> 'Connection':
|
|
48
|
+
return Connection(self.host, self.port, self.username, self.password, self.database_name)
|
|
49
|
+
|
|
46
50
|
def __str__(self) -> str:
|
|
47
51
|
user = f'{self.username}@' if self.username is not None else ''
|
|
48
52
|
return f'PostgreSQL: {user}{self.host}:{self.port}/{self.database_name}'
|