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.
Files changed (106) hide show
  1. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/PKG-INFO +13 -12
  2. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/README.md +11 -10
  3. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/setup.py +1 -1
  4. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Connection.py +3 -0
  5. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/duckdb/Connection.py +3 -0
  6. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/postgres/Connection.py +4 -0
  7. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/sqlite/Connection.py +3 -0
  8. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/kernel.py +187 -166
  9. jupyter_duckdb-1.2.103/src/duckdb_kernel/magics/MagicCommandCallback.py +24 -0
  10. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/MagicCommandHandler.py +9 -9
  11. jupyter_duckdb-1.2.103/src/duckdb_kernel/magics/MagicState.py +11 -0
  12. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/__init__.py +1 -0
  13. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/PKG-INFO +13 -12
  14. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/SOURCES.txt +1 -1
  15. jupyter_duckdb-1.2.102/src/duckdb_kernel/magics/MagicCommandCallback.py +0 -31
  16. jupyter_duckdb-1.2.102/src/duckdb_kernel/magics/StringWrapper.py +0 -3
  17. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/setup.cfg +0 -0
  18. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/__init__.py +0 -0
  19. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/__main__.py +0 -0
  20. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Column.py +0 -0
  21. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Constraint.py +0 -0
  22. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/DatabaseError.py +0 -0
  23. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/ForeignKey.py +0 -0
  24. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/Table.py +0 -0
  25. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/__init__.py +0 -0
  26. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/error/EmptyResultError.py +0 -0
  27. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/error/__init__.py +0 -0
  28. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/duckdb/__init__.py +0 -0
  29. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/postgres/__init__.py +0 -0
  30. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/postgres/util.py +0 -0
  31. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/db/implementation/sqlite/__init__.py +0 -0
  32. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/kernel.json +0 -0
  33. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/MagicCommand.py +0 -0
  34. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/magics/MagicCommandException.py +0 -0
  35. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/DCParser.py +0 -0
  36. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/LogicParser.py +0 -0
  37. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/ParserError.py +0 -0
  38. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/RAParser.py +0 -0
  39. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/__init__.py +0 -0
  40. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/DCOperand.py +0 -0
  41. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/LogicElement.py +0 -0
  42. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/LogicOperand.py +0 -0
  43. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/LogicOperator.py +0 -0
  44. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RABinaryOperator.py +0 -0
  45. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAElement.py +0 -0
  46. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAOperand.py +0 -0
  47. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAOperator.py +0 -0
  48. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/RAUnaryOperator.py +0 -0
  49. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/__init__.py +0 -0
  50. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Add.py +0 -0
  51. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/And.py +0 -0
  52. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/ArrowLeft.py +0 -0
  53. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/ConditionalSet.py +0 -0
  54. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Cross.py +0 -0
  55. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Difference.py +0 -0
  56. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Divide.py +0 -0
  57. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Division.py +0 -0
  58. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Equal.py +0 -0
  59. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/FullOuterJoin.py +0 -0
  60. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/GreaterThan.py +0 -0
  61. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/GreaterThanEqual.py +0 -0
  62. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Intersection.py +0 -0
  63. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Join.py +0 -0
  64. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/LeftOuterJoin.py +0 -0
  65. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/LessThan.py +0 -0
  66. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/LessThanEqual.py +0 -0
  67. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Minus.py +0 -0
  68. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Multiply.py +0 -0
  69. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Or.py +0 -0
  70. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/RightOuterJoin.py +0 -0
  71. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Unequal.py +0 -0
  72. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/Union.py +0 -0
  73. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/binary/__init__.py +0 -0
  74. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Not.py +0 -0
  75. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Projection.py +0 -0
  76. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Rename.py +0 -0
  77. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/Selection.py +0 -0
  78. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/elements/unary/__init__.py +0 -0
  79. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/tokenizer/Token.py +0 -0
  80. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/tokenizer/Tokenizer.py +0 -0
  81. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/tokenizer/__init__.py +0 -0
  82. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/util/RenamableColumn.py +0 -0
  83. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/util/RenamableColumnList.py +0 -0
  84. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/parser/util/__init__.py +0 -0
  85. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/__init__.py +0 -0
  86. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_dc.py +0 -0
  87. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_ra.py +0 -0
  88. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_result_comparison.py +0 -0
  89. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/tests/test_sql.py +0 -0
  90. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/ResultSetComparator.py +0 -0
  91. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/SQL.py +0 -0
  92. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/TestError.py +0 -0
  93. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/__init__.py +0 -0
  94. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/util/formatting.py +0 -0
  95. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/Drawer.py +0 -0
  96. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/Plotly.py +0 -0
  97. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/RATreeDrawer.py +0 -0
  98. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/SchemaDrawer.py +0 -0
  99. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/__init__.py +0 -0
  100. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/__init__.py +0 -0
  101. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/plotly-3.0.1.min.js +0 -0
  102. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/ra.css +0 -0
  103. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/duckdb_kernel/visualization/lib/ra.js +0 -0
  104. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/dependency_links.txt +0 -0
  105. {jupyter_duckdb-1.2.102 → jupyter_duckdb-1.2.103}/src/jupyter_duckdb.egg-info/requires.txt +0 -0
  106. {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.2
1
+ Metadata-Version: 2.4
2
2
  Name: jupyter-duckdb
3
- Version: 1.2.102
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
- last optional parameter `WITH_TESTS` is described in
122
- detail [below](#ship-tests-with-your-notebooks).
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`! `WITH_TESTS` on
130
- the other hand is available also with this magic command.)
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
- Only one database can be open at any time. If a new database is created or
137
- loaded, the current one is closed first and saved to disk if necessary.
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 together with the database with the help of
217
- the `WITH_TESTS` parameter. These tests are stored as a JSON file. Each test is
218
- assigned a unique name, a result set and whether the test should check the order
219
- of the result. A very simple test file looks like the following JSON object:
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
- last optional parameter `WITH_TESTS` is described in
94
- detail [below](#ship-tests-with-your-notebooks).
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`! `WITH_TESTS` on
102
- the other hand is available also with this magic command.)
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
- Only one database can be open at any time. If a new database is created or
109
- loaded, the current one is closed first and saved to disk if necessary.
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 together with the database with the help of
189
- the `WITH_TESTS` parameter. These tests are stored as a JSON file. Each test is
190
- assigned a unique name, a result set and whether the test should check the order
191
- of the result. A very simple test file looks like the following JSON object:
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
  {
@@ -1,7 +1,7 @@
1
1
  import os
2
2
 
3
3
  # configuration
4
- PACKAGE_VERSION = '1.2.102'
4
+ PACKAGE_VERSION = '1.2.103'
5
5
  DUCKDB_VERSION = '1.2.1'
6
6
 
7
7
  DEPENDENCIES = [
@@ -10,6 +10,9 @@ class Connection:
10
10
  def close(self):
11
11
  pass
12
12
 
13
+ def copy(self) -> 'Connection':
14
+ raise NotImplementedError
15
+
13
16
  @staticmethod
14
17
  def plain_explain() -> bool:
15
18
  return False
@@ -15,6 +15,9 @@ class Connection(Base):
15
15
  def close(self):
16
16
  self.con.close()
17
17
 
18
+ def copy(self) -> 'Connection':
19
+ return Connection(self.path)
20
+
18
21
  @staticmethod
19
22
  def plain_explain() -> bool:
20
23
  return True
@@ -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}'
@@ -16,6 +16,9 @@ class Connection(Base):
16
16
  def close(self):
17
17
  self.con.close()
18
18
 
19
+ def copy(self) -> 'Connection':
20
+ return Connection(self.path)
21
+
19
22
  @staticmethod
20
23
  def multiple_statements_per_query() -> bool:
21
24
  return False