satisfactoscript 0.6.0__tar.gz → 0.6.1__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.
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/PKG-INFO +1 -1
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/pyproject.toml +1 -1
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/core.py +31 -4
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/PKG-INFO +1 -1
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/README.md +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/setup.cfg +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/__init__.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/agentic/__init__.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/agentic/agent.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/__init__.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/config.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/loaders.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/registry.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/registry.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/semantic/__init__.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/semantic/semantic.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/utils.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/SOURCES.txt +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/dependency_links.txt +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/requires.txt +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/top_level.txt +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_config.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_connect_patch.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_env_detection.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_join.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_username.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_dummy.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_loaders.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_registry.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_registry_import_paths.py +0 -0
- {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_utils_safe_columns.py +0 -0
|
@@ -502,13 +502,40 @@ class SatisfactoEngine:
|
|
|
502
502
|
|
|
503
503
|
def _drop_table_if_exists(self, fqn):
|
|
504
504
|
"""
|
|
505
|
-
Drops a table using
|
|
506
|
-
|
|
505
|
+
Drops a table if it exists, using two strategies in order:
|
|
506
|
+
1. Spark SQL DROP TABLE IF EXISTS (works natively on Databricks).
|
|
507
|
+
2. Databricks SDK REST API (works locally when gRPC DDL fails with UserContext).
|
|
508
|
+
|
|
507
509
|
Args:
|
|
508
|
-
fqn (str): The Fully Qualified Name of the table.
|
|
510
|
+
fqn (str): The Fully Qualified Name of the table (backtick-quoted).
|
|
509
511
|
"""
|
|
510
512
|
print(f" -> [Cleanup] Dropping table if exists: {fqn}")
|
|
511
|
-
|
|
513
|
+
|
|
514
|
+
# Strategy 1: Spark SQL (works natively on Databricks)
|
|
515
|
+
try:
|
|
516
|
+
self.spark.sql(f"DROP TABLE IF EXISTS {fqn}")
|
|
517
|
+
return
|
|
518
|
+
except Exception:
|
|
519
|
+
pass
|
|
520
|
+
|
|
521
|
+
# Strategy 2: Databricks SDK REST API (works locally when gRPC DDL fails)
|
|
522
|
+
try:
|
|
523
|
+
from databricks.sdk import WorkspaceClient
|
|
524
|
+
host = os.getenv("DATABRICKS_HOST")
|
|
525
|
+
token = os.getenv("DATABRICKS_TOKEN")
|
|
526
|
+
if host and token:
|
|
527
|
+
clean_fqn = fqn.replace("`", "")
|
|
528
|
+
w = WorkspaceClient(host=host, token=token)
|
|
529
|
+
try:
|
|
530
|
+
w.tables.delete(clean_fqn)
|
|
531
|
+
except Exception:
|
|
532
|
+
# Table does not exist — equivalent to IF EXISTS, not an error
|
|
533
|
+
pass
|
|
534
|
+
return
|
|
535
|
+
except Exception:
|
|
536
|
+
pass
|
|
537
|
+
|
|
538
|
+
print(f" -> [Cleanup] WARNING: Could not drop {fqn} via SQL or SDK. Continuing anyway.")
|
|
512
539
|
|
|
513
540
|
def _write_dataframe(self, df, fqn, label):
|
|
514
541
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/requires.txt
RENAMED
|
File without changes
|
{satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|