pyfabric-dev 0.4.0__tar.gz → 0.5.0__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 (31) hide show
  1. {pyfabric_dev-0.4.0/pyfabric_dev.egg-info → pyfabric_dev-0.5.0}/PKG-INFO +2 -2
  2. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/README.md +1 -1
  3. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/__init__.py +1 -1
  4. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/cli/generate_notebooks.py +4 -4
  5. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/cli/run_tests_parallel.py +1 -1
  6. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/functions.py +1 -1
  7. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/local_config.py +6 -0
  8. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/runners/notebook.py +8 -0
  9. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0/pyfabric_dev.egg-info}/PKG-INFO +2 -2
  10. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyproject.toml +1 -1
  11. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/LICENSE +0 -0
  12. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/NOTICE +0 -0
  13. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/cli/__init__.py +0 -0
  14. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/cli/run_notebook.py +0 -0
  15. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/cli/run_pipeline.py +0 -0
  16. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/defs.py +0 -0
  17. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/fabric.py +0 -0
  18. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/local_env.py +0 -0
  19. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/mock_notebookutils.py +0 -0
  20. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/runners/__init__.py +0 -0
  21. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/runners/hooks.py +0 -0
  22. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/runners/pipeline.py +0 -0
  23. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev/spark.py +0 -0
  24. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev.egg-info/SOURCES.txt +0 -0
  25. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev.egg-info/dependency_links.txt +0 -0
  26. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev.egg-info/entry_points.txt +0 -0
  27. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev.egg-info/requires.txt +0 -0
  28. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/pyfabric_dev.egg-info/top_level.txt +0 -0
  29. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/setup.cfg +0 -0
  30. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/tests/test_functions_merge.py +0 -0
  31. {pyfabric_dev-0.4.0 → pyfabric_dev-0.5.0}/tests/test_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfabric-dev
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Local development framework for Microsoft Fabric notebooks: source-of-truth Python, generated .Notebook artifacts, mocked Fabric APIs, parallel local testing.
5
5
  Author-email: CashHero <engineering@cashhero.ai>
6
6
  License: Apache-2.0
@@ -37,7 +37,7 @@ A development framework for [Microsoft Fabric](https://www.microsoft.com/fabric)
37
37
  notebooks. Write plain Python modules in `src/`, generate Fabric `.Notebook`
38
38
  artifacts from them, and run + test everything locally with mocked Fabric APIs.
39
39
 
40
- > **Status:** `v0.4.0`. APIs are stabilizing but pre-1.0; minor versions may break.
40
+ > **Status:** `v0.5.0`. APIs are stabilizing but pre-1.0; minor versions may break.
41
41
  >
42
42
  > **Disclaimer:** not affiliated with or endorsed by Microsoft.
43
43
 
@@ -4,7 +4,7 @@ A development framework for [Microsoft Fabric](https://www.microsoft.com/fabric)
4
4
  notebooks. Write plain Python modules in `src/`, generate Fabric `.Notebook`
5
5
  artifacts from them, and run + test everything locally with mocked Fabric APIs.
6
6
 
7
- > **Status:** `v0.4.0`. APIs are stabilizing but pre-1.0; minor versions may break.
7
+ > **Status:** `v0.5.0`. APIs are stabilizing but pre-1.0; minor versions may break.
8
8
  >
9
9
  > **Disclaimer:** not affiliated with or endorsed by Microsoft.
10
10
 
@@ -1,3 +1,3 @@
1
1
  """pyfabric-dev: local development framework for Microsoft Fabric notebooks."""
2
2
 
3
- __version__ = "0.4.0"
3
+ __version__ = "0.5.0"
@@ -54,7 +54,7 @@ NOTEBOOK_GEN_DEFAULTS = {
54
54
  # their own code in src/common and let pip own the framework runtime.
55
55
  "inline_framework_modules": False,
56
56
  # Extra src/common modules inlined into common_functions after the primary
57
- # functions module (e.g. ["cashhero_org.py"]).
57
+ # functions module (e.g. ["domain_helpers.py"]).
58
58
  "common_functions_extra_modules": [],
59
59
  "helper_notebooks": [],
60
60
  "notebook_run_dependencies": {},
@@ -351,9 +351,9 @@ def read_module_code(module_path: Path, skip_imports: list[str] = None, skip_top
351
351
  def generate_common_defs_notebook() -> str:
352
352
  """Generate the common_defs notebook content with inlined code.
353
353
 
354
- Inlines framework_defs.py first, then defs.py (with the
355
- framework_defs cross-import stripped). framework_defs is the
356
- framework-extractable subset; defs.py holds CashHero specifics.
354
+ Inlines the framework defs module first, then defs.py (with the
355
+ framework_defs cross-import stripped). The framework defs module is the
356
+ shared subset; defs.py holds the consumer's project-specific definitions.
357
357
  """
358
358
  project_root = PROJECT_ROOT
359
359
  inline_framework = NOTEBOOK_GEN_CONFIG.get("inline_framework_modules", False)
@@ -302,7 +302,7 @@ def main():
302
302
  return
303
303
 
304
304
  # Worker tmpdir lives under DEV_BASE_DIR so it follows whatever the
305
- # consumer configured (e.g. ~/.cashhero_fabric_dev/<hash>/...).
305
+ # consumer configured (e.g. ~/.fabric_dev/<hash>/...).
306
306
  from pyfabric_dev.local_config import DEV_BASE_DIR
307
307
  tmp_base = str(DEV_BASE_DIR / "_parallel_workers")
308
308
 
@@ -358,7 +358,7 @@ def cf_merge_into_table(
358
358
  note below — so callers effectively never deleted; False makes the
359
359
  default match that real behavior.)
360
360
  not_matched_by_source_condition: Optional SQL predicate (referencing the
361
- ``target`` alias, e.g. ``"target.server IN ('cashhero')"``) that
361
+ ``target`` alias, e.g. ``"target.source_system IN ('crm')"``) that
362
362
  restricts which unmatched target rows are deleted. Only applies when
363
363
  ``delete_when_not_matched_by_source`` is True. Use it when the source
364
364
  is a complete snapshot of only a subset of the target (e.g. one data
@@ -48,6 +48,12 @@ _default_base_dir_name = os.getenv("FABRIC_DEV_BASE_DIR_NAME", ".fabric_dev")
48
48
  DEV_BASE_DIR = Path(
49
49
  os.getenv("DEV_BASE_DIR", Path.home() / _default_base_dir_name / _worktree_hash)
50
50
  )
51
+ # Export the resolved value so inlined notebook code (which can't import this
52
+ # module under Fabric) can detect local execution by reading os.environ —
53
+ # e.g. a cf_get_lakehouse_path that routes under DEV_BASE_DIR locally and
54
+ # /lakehouse/default in Fabric. setdefault preserves any value already set
55
+ # (e.g. the per-worker dir the parallel test runner injects).
56
+ os.environ.setdefault("DEV_BASE_DIR", str(DEV_BASE_DIR))
51
57
 
52
58
  # Local lakehouse paths (stand in for /lakehouse/default in Fabric).
53
59
  LOCAL_LAKEHOUSE_PATH = DEV_BASE_DIR / "lakehouse" / "default"
@@ -293,6 +293,14 @@ class NotebookRunner:
293
293
  or self.hooks.common_functions_name in str(notebook_path)
294
294
  )
295
295
 
296
+ # Ensure a Delta-enabled Spark session is available before any cell
297
+ # runs. Hook-less CLI runs inject no `_spark`, and a notebook's own
298
+ # ``getOrCreate()`` would otherwise yield a session without Delta
299
+ # wired in. Consumers that supply ``_spark`` via hooks are untouched.
300
+ if "_spark" not in self.globals_dict:
301
+ from pyfabric_dev.spark import create_spark_session
302
+ self.globals_dict["_spark"] = create_spark_session()
303
+
296
304
  for i, cell in enumerate(cells, 1):
297
305
  pending_db = getattr(self, "_pending_default_db", None)
298
306
  if pending_db and "_spark" in self.globals_dict:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfabric-dev
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Local development framework for Microsoft Fabric notebooks: source-of-truth Python, generated .Notebook artifacts, mocked Fabric APIs, parallel local testing.
5
5
  Author-email: CashHero <engineering@cashhero.ai>
6
6
  License: Apache-2.0
@@ -37,7 +37,7 @@ A development framework for [Microsoft Fabric](https://www.microsoft.com/fabric)
37
37
  notebooks. Write plain Python modules in `src/`, generate Fabric `.Notebook`
38
38
  artifacts from them, and run + test everything locally with mocked Fabric APIs.
39
39
 
40
- > **Status:** `v0.4.0`. APIs are stabilizing but pre-1.0; minor versions may break.
40
+ > **Status:** `v0.5.0`. APIs are stabilizing but pre-1.0; minor versions may break.
41
41
  >
42
42
  > **Disclaimer:** not affiliated with or endorsed by Microsoft.
43
43
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyfabric-dev"
7
- version = "0.4.0"
7
+ version = "0.5.0"
8
8
  description = "Local development framework for Microsoft Fabric notebooks: source-of-truth Python, generated .Notebook artifacts, mocked Fabric APIs, parallel local testing."
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
File without changes
File without changes
File without changes