duckrun 0.2.13__py3-none-any.whl → 0.2.14.dev0__py3-none-any.whl
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.
Potentially problematic release.
This version of duckrun might be problematic. Click here for more details.
- duckrun/core.py +18 -5
- {duckrun-0.2.13.dist-info → duckrun-0.2.14.dev0.dist-info}/METADATA +1 -1
- {duckrun-0.2.13.dist-info → duckrun-0.2.14.dev0.dist-info}/RECORD +6 -6
- {duckrun-0.2.13.dist-info → duckrun-0.2.14.dev0.dist-info}/WHEEL +0 -0
- {duckrun-0.2.13.dist-info → duckrun-0.2.14.dev0.dist-info}/licenses/LICENSE +0 -0
- {duckrun-0.2.13.dist-info → duckrun-0.2.14.dev0.dist-info}/top_level.txt +0 -0
duckrun/core.py
CHANGED
|
@@ -53,7 +53,8 @@ class Duckrun:
|
|
|
53
53
|
|
|
54
54
|
def __init__(self, workspace_id: str, lakehouse_id: str, schema: str = "dbo",
|
|
55
55
|
sql_folder: Optional[str] = None, compaction_threshold: int = 10,
|
|
56
|
-
scan_all_schemas: bool = False, storage_account: str = "onelake"
|
|
56
|
+
scan_all_schemas: bool = False, storage_account: str = "onelake",
|
|
57
|
+
token_only: bool = False):
|
|
57
58
|
# Store GUIDs for internal use
|
|
58
59
|
self.workspace_id = workspace_id
|
|
59
60
|
self.lakehouse_id = lakehouse_id
|
|
@@ -62,6 +63,7 @@ class Duckrun:
|
|
|
62
63
|
self.compaction_threshold = compaction_threshold
|
|
63
64
|
self.scan_all_schemas = scan_all_schemas
|
|
64
65
|
self.storage_account = storage_account
|
|
66
|
+
self.token_only = token_only
|
|
65
67
|
|
|
66
68
|
# Construct proper ABFSS URLs
|
|
67
69
|
import re
|
|
@@ -93,12 +95,19 @@ class Duckrun:
|
|
|
93
95
|
except ImportError:
|
|
94
96
|
pass # Not in Colab, use default transport
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
# Only attach lakehouse and register functions if not token_only mode
|
|
99
|
+
if not token_only:
|
|
100
|
+
self._attach_lakehouse()
|
|
101
|
+
self._register_lookup_functions()
|
|
102
|
+
else:
|
|
103
|
+
# In token_only mode, just create the secret for authentication
|
|
104
|
+
self._create_onelake_secret()
|
|
105
|
+
print("✓ Token authenticated (fast mode - tables not listed)")
|
|
98
106
|
|
|
99
107
|
@classmethod
|
|
100
108
|
def connect(cls, connection_string: str, sql_folder: Optional[str] = None,
|
|
101
|
-
compaction_threshold: int = 100, storage_account: str = "onelake"
|
|
109
|
+
compaction_threshold: int = 100, storage_account: str = "onelake",
|
|
110
|
+
token_only: bool = False):
|
|
102
111
|
"""
|
|
103
112
|
Create and connect to lakehouse or workspace.
|
|
104
113
|
|
|
@@ -112,6 +121,7 @@ class Duckrun:
|
|
|
112
121
|
sql_folder: Optional path or URL to SQL files folder
|
|
113
122
|
compaction_threshold: File count threshold for compaction
|
|
114
123
|
storage_account: Storage account name (default: "onelake")
|
|
124
|
+
token_only: If True, only authenticate without listing tables (faster connection)
|
|
115
125
|
|
|
116
126
|
Examples:
|
|
117
127
|
# Workspace management only (supports spaces in names)
|
|
@@ -125,6 +135,9 @@ class Duckrun:
|
|
|
125
135
|
dr = Duckrun.connect("My Workspace/My Lakehouse.lakehouse") # defaults to dbo schema
|
|
126
136
|
dr = Duckrun.connect("workspace/lakehouse.lakehouse", storage_account="xxx-onelake") # custom storage
|
|
127
137
|
|
|
138
|
+
# Fast connection without table listing (token only)
|
|
139
|
+
dr = Duckrun.connect("workspace/lakehouse.lakehouse", token_only=True)
|
|
140
|
+
|
|
128
141
|
Note:
|
|
129
142
|
Internally resolves friendly names (with spaces) to GUIDs and constructs proper ABFSS URLs:
|
|
130
143
|
"My Workspace/My Lakehouse.lakehouse/schema" becomes
|
|
@@ -169,7 +182,7 @@ class Duckrun:
|
|
|
169
182
|
# Resolve friendly names to GUIDs and construct proper ABFSS path
|
|
170
183
|
workspace_id, lakehouse_id = cls._resolve_names_to_guids(workspace_name, lakehouse_name)
|
|
171
184
|
|
|
172
|
-
return cls(workspace_id, lakehouse_id, schema, sql_folder, compaction_threshold, scan_all_schemas, storage_account)
|
|
185
|
+
return cls(workspace_id, lakehouse_id, schema, sql_folder, compaction_threshold, scan_all_schemas, storage_account, token_only)
|
|
173
186
|
|
|
174
187
|
@classmethod
|
|
175
188
|
def _resolve_names_to_guids(cls, workspace_name: str, lakehouse_name: str) -> tuple[str, str]:
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
duckrun/__init__.py,sha256=cTj6KQ6hKmgu1z7k9nhDcO5lct049luxjx1V0QnymCo,235
|
|
2
2
|
duckrun/auth.py,sha256=dMqIzozgEQ5v7Uc3Mb_OoFZGmsAq0m-VOoYCVL7rehc,9281
|
|
3
|
-
duckrun/core.py,sha256=
|
|
3
|
+
duckrun/core.py,sha256=yuF8sqAc9rUARBnfRP0y_umXcR9RVBI0BqD5kVNohIA,53027
|
|
4
4
|
duckrun/files.py,sha256=Fvdjg3DyHJzIVzKo8M_j-eGz4zU61lOB38Y_onbQJkI,10137
|
|
5
5
|
duckrun/lakehouse.py,sha256=j--Z3zo8AOWt1GF9VzRosmmTAy6ey2D0LVubti58twU,14109
|
|
6
6
|
duckrun/runner.py,sha256=yrDxfy1RVkb8iK9GKGmIFZHzCvcO_0GVQlbng7Vw_iM,14171
|
|
7
7
|
duckrun/semantic_model.py,sha256=obzlN2-dbEW3JmDop-vrZGGGLi9u3ThhTbgtDjou7uY,29509
|
|
8
8
|
duckrun/stats.py,sha256=oKIjZ7u5cFVT63FuOl5UqoDsOG3098woSCn-uI6i_sQ,11084
|
|
9
9
|
duckrun/writer.py,sha256=svUuPCYOhrz299NgnpTKhARKjfej0PxnoND2iPDSypk,8098
|
|
10
|
-
duckrun-0.2.
|
|
11
|
-
duckrun-0.2.
|
|
12
|
-
duckrun-0.2.
|
|
13
|
-
duckrun-0.2.
|
|
14
|
-
duckrun-0.2.
|
|
10
|
+
duckrun-0.2.14.dev0.dist-info/licenses/LICENSE,sha256=-DeQQwdbCbkB4507ZF3QbocysB-EIjDtaLexvqRkGZc,1083
|
|
11
|
+
duckrun-0.2.14.dev0.dist-info/METADATA,sha256=85HpNTjuldX2LdKS4R3nxbrJtpHtRoKQ9tcabFDiIuM,20771
|
|
12
|
+
duckrun-0.2.14.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
duckrun-0.2.14.dev0.dist-info/top_level.txt,sha256=BknMEwebbUHrVAp3SC92ps8MPhK7XSYsaogTvi_DmEU,8
|
|
14
|
+
duckrun-0.2.14.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|