duckrun 0.2.12__py3-none-any.whl → 0.2.13__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.
- duckrun/auth.py +9 -15
- duckrun/core.py +8 -11
- {duckrun-0.2.12.dist-info → duckrun-0.2.13.dist-info}/METADATA +1 -1
- {duckrun-0.2.12.dist-info → duckrun-0.2.13.dist-info}/RECORD +7 -7
- {duckrun-0.2.12.dist-info → duckrun-0.2.13.dist-info}/WHEEL +0 -0
- {duckrun-0.2.12.dist-info → duckrun-0.2.13.dist-info}/licenses/LICENSE +0 -0
- {duckrun-0.2.12.dist-info → duckrun-0.2.13.dist-info}/top_level.txt +0 -0
duckrun/auth.py
CHANGED
|
@@ -20,7 +20,6 @@ def get_token() -> Optional[str]:
|
|
|
20
20
|
# Check if we already have a cached token
|
|
21
21
|
token_env = os.environ.get("AZURE_STORAGE_TOKEN")
|
|
22
22
|
if token_env and token_env != "PLACEHOLDER_TOKEN_TOKEN_NOT_AVAILABLE":
|
|
23
|
-
print("✅ Using existing Azure Storage token")
|
|
24
23
|
return token_env
|
|
25
24
|
|
|
26
25
|
print("🔐 Starting Azure authentication...")
|
|
@@ -38,21 +37,16 @@ def get_token() -> Optional[str]:
|
|
|
38
37
|
except Exception as e:
|
|
39
38
|
print(f"⚠️ Fabric notebook authentication failed: {e}")
|
|
40
39
|
|
|
41
|
-
#
|
|
40
|
+
# Try local/VS Code authentication (Azure CLI + browser)
|
|
41
|
+
print("🖥️ Trying local authentication (Azure CLI + browser fallback)...")
|
|
42
|
+
token = _get_local_token()
|
|
43
|
+
if token:
|
|
44
|
+
return token
|
|
45
|
+
|
|
46
|
+
# If local auth failed, fall back to device code flow
|
|
47
|
+
print("🔐 Falling back to device code flow for remote/headless environment...")
|
|
42
48
|
try:
|
|
43
|
-
|
|
44
|
-
try:
|
|
45
|
-
import google.colab
|
|
46
|
-
print("🚀 Google Colab detected - using device code flow")
|
|
47
|
-
return _get_device_code_token()
|
|
48
|
-
except ImportError:
|
|
49
|
-
pass
|
|
50
|
-
|
|
51
|
-
# For all other environments (including VS Code), try Azure CLI first
|
|
52
|
-
# This includes local development, VS Code notebooks, etc.
|
|
53
|
-
print("🖥️ Local/VS Code environment detected - trying Azure CLI first, then browser fallback")
|
|
54
|
-
return _get_local_token()
|
|
55
|
-
|
|
49
|
+
return _get_device_code_token()
|
|
56
50
|
except Exception as e:
|
|
57
51
|
print(f"❌ Authentication failed: {e}")
|
|
58
52
|
print("💡 Try refreshing and running again, or check your Azure permissions")
|
duckrun/core.py
CHANGED
|
@@ -401,15 +401,8 @@ class Duckrun:
|
|
|
401
401
|
if not tables:
|
|
402
402
|
return
|
|
403
403
|
|
|
404
|
-
#
|
|
405
|
-
|
|
406
|
-
for schema_name, table_name in tables:
|
|
407
|
-
if schema_name not in schema_tables:
|
|
408
|
-
schema_tables[schema_name] = []
|
|
409
|
-
schema_tables[schema_name].append(table_name)
|
|
410
|
-
|
|
411
|
-
attached_count = 0
|
|
412
|
-
skipped_tables = []
|
|
404
|
+
# Collect table names for display
|
|
405
|
+
table_names = []
|
|
413
406
|
|
|
414
407
|
for schema_name, table_name in tables:
|
|
415
408
|
try:
|
|
@@ -417,18 +410,22 @@ class Duckrun:
|
|
|
417
410
|
# Create proper schema.table structure in DuckDB
|
|
418
411
|
self.con.sql(f"CREATE SCHEMA IF NOT EXISTS {schema_name}")
|
|
419
412
|
view_name = f"{schema_name}.{table_name}"
|
|
413
|
+
table_names.append(view_name)
|
|
420
414
|
else:
|
|
421
415
|
# Single schema mode - use just table name
|
|
422
416
|
view_name = table_name
|
|
417
|
+
table_names.append(table_name)
|
|
423
418
|
|
|
424
419
|
self.con.sql(f"""
|
|
425
420
|
CREATE OR REPLACE VIEW {view_name}
|
|
426
421
|
AS SELECT * FROM delta_scan('{self.table_base_url}{schema_name}/{table_name}');
|
|
427
422
|
""")
|
|
428
|
-
attached_count += 1
|
|
429
423
|
except Exception as e:
|
|
430
|
-
skipped_tables.append(f"{schema_name}.{table_name}")
|
|
431
424
|
continue
|
|
425
|
+
|
|
426
|
+
# Print discovered tables as comma-separated list
|
|
427
|
+
if table_names:
|
|
428
|
+
print(", ".join(table_names))
|
|
432
429
|
|
|
433
430
|
except Exception as e:
|
|
434
431
|
print(f"❌ Error attaching lakehouse: {e}")
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
duckrun/__init__.py,sha256=cTj6KQ6hKmgu1z7k9nhDcO5lct049luxjx1V0QnymCo,235
|
|
2
|
-
duckrun/auth.py,sha256=
|
|
3
|
-
duckrun/core.py,sha256=
|
|
2
|
+
duckrun/auth.py,sha256=dMqIzozgEQ5v7Uc3Mb_OoFZGmsAq0m-VOoYCVL7rehc,9281
|
|
3
|
+
duckrun/core.py,sha256=C5nnL-MheBfJPcw-Jr8t14jsm2iwMF07cYm8g_AXtFQ,52303
|
|
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.13.dist-info/licenses/LICENSE,sha256=-DeQQwdbCbkB4507ZF3QbocysB-EIjDtaLexvqRkGZc,1083
|
|
11
|
+
duckrun-0.2.13.dist-info/METADATA,sha256=0r-l8dWnd8KLBGj7cspK53eUdaDeUG-iHsa74rGBaCo,20766
|
|
12
|
+
duckrun-0.2.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
duckrun-0.2.13.dist-info/top_level.txt,sha256=BknMEwebbUHrVAp3SC92ps8MPhK7XSYsaogTvi_DmEU,8
|
|
14
|
+
duckrun-0.2.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|