Skip to content

refactor: simplify project structure — flatten notebooks, remove boilerplate#219

Open
veenaramesh wants to merge 3 commits into
databricks:testfrom
veenaramesh:refactor/simplify-project-structure
Open

refactor: simplify project structure — flatten notebooks, remove boilerplate#219
veenaramesh wants to merge 3 commits into
databricks:testfrom
veenaramesh:refactor/simplify-project-structure

Conversation

@veenaramesh

Copy link
Copy Markdown
Collaborator

Summary

  • Move all notebooks out of notebooks/ subdirectories to sit alongside their helper modules
  • Remove %cd $notebook_path and sys.path.append boilerplate from all notebooks
  • Remove legacy cookiecutter.json stub

This eliminates the %cd hacks needed to import from parent directories and simplifies the project layout for a data science workflow.

Test plan

  • databricks bundle init generates project successfully for all parameter combinations
  • Notebook paths resolve correctly in deployed jobs
  • Sibling imports (e.g. from predict import predict_batch) work without %cd

Move all Databricks notebooks out of nested notebooks/ subdirectories
to sit alongside their sibling helper modules. This eliminates the
%cd .. hacks that were needed to import from parent directories and
simplifies the project layout for a data science workflow.

Moves:
- training/notebooks/*.py → training/*.py
- validation/notebooks/ModelValidation.py → validation/ModelValidation.py
- deployment/*/notebooks/*.py → deployment/*/*.py
- feature_engineering/notebooks/*.py → feature_engineering/*.py
- monitoring/notebooks/*.py → monitoring/*.py

Updates all resource YAMLs, update_layout.tmpl, and README references.

Co-authored-by: Isaac
Databricks bundle deployments set the notebook CWD correctly, so
the notebook_path/%cd $notebook_path pattern is unnecessary. Sibling
imports work naturally after the flatten-notebooks change.

Also inlines the trivial get_deployed_model_stage_for_env helper
(a dict lookup) to eliminate cross-directory sys.path.append in
deploy.py and BatchInference.py.

Co-authored-by: Isaac
No longer needed with databricks bundle init.

Co-authored-by: Isaac
@veenaramesh veenaramesh force-pushed the refactor/simplify-project-structure branch from 7262f50 to 77160b2 Compare June 12, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant