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.
Files changed (32) hide show
  1. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/PKG-INFO +1 -1
  2. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/pyproject.toml +1 -1
  3. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/core.py +31 -4
  4. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/PKG-INFO +1 -1
  5. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/README.md +0 -0
  6. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/setup.cfg +0 -0
  7. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/__init__.py +0 -0
  8. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/agentic/__init__.py +0 -0
  9. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/agentic/agent.py +0 -0
  10. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/__init__.py +0 -0
  11. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/config.py +0 -0
  12. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/loaders.py +0 -0
  13. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/core/registry.py +0 -0
  14. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/registry.py +0 -0
  15. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/semantic/__init__.py +0 -0
  16. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/semantic/semantic.py +0 -0
  17. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript/utils.py +0 -0
  18. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/SOURCES.txt +0 -0
  19. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/dependency_links.txt +0 -0
  20. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/requires.txt +0 -0
  21. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/src/satisfactoscript.egg-info/top_level.txt +0 -0
  22. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_config.py +0 -0
  23. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core.py +0 -0
  24. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_connect_patch.py +0 -0
  25. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_env_detection.py +0 -0
  26. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_join.py +0 -0
  27. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_core_username.py +0 -0
  28. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_dummy.py +0 -0
  29. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_loaders.py +0 -0
  30. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_registry.py +0 -0
  31. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_registry_import_paths.py +0 -0
  32. {satisfactoscript-0.6.0 → satisfactoscript-0.6.1}/tests/test_utils_safe_columns.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: satisfactoscript
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: An Enterprise-Ready, Declarative Data Engineering Framework for Databricks Lakehouse.
5
5
  Author: julhouba
6
6
  Classifier: Programming Language :: Python :: 3
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "satisfactoscript"
7
- version = "0.6.0"
7
+ version = "0.6.1"
8
8
  description = "An Enterprise-Ready, Declarative Data Engineering Framework for Databricks Lakehouse."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -502,13 +502,40 @@ class SatisfactoEngine:
502
502
 
503
503
  def _drop_table_if_exists(self, fqn):
504
504
  """
505
- Drops a table using SQL directly if it exists.
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
- self.spark.sql(f"DROP TABLE IF EXISTS {fqn}")
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
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: satisfactoscript
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: An Enterprise-Ready, Declarative Data Engineering Framework for Databricks Lakehouse.
5
5
  Author: julhouba
6
6
  Classifier: Programming Language :: Python :: 3