Skip to content

Commit b082b2d

Browse files
authored
feat(config): Add support for overriding framework config (#28)
* Implement framework config_overrides * Clean up GLOBAL_CONFIG string values * Rename folder to config_override * Add info to .gitkeep * Update ./config_override .gitignore info * Move helper functions to utility module and add config_override doco * Fix feature doco typo * Remove redundant imports and import formatting changes * BREAKING CHANGE: Move src/config to src/config/default * REmove temporary config overrides from testing
1 parent f6fe798 commit b082b2d

22 files changed

+170
-28
lines changed

docs/source/feature_builder_parallelization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Configuration
5555

5656
Global Configuration
5757
~~~~~~~~~~~~~~~~~~~~~
58-
Configure these parameters globally for all pipelines in your ``src/config/global.json|yaml`` file:
58+
Configure these parameters globally for all pipelines in your ``src/config/default/global.json|yaml`` file:
5959

6060
.. tabs::
6161

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Framework configuration
2+
=======================
3+
4+
.. list-table::
5+
:header-rows: 0
6+
7+
* - **Applies To:**
8+
- :bdg-info:`Framework Bundle`
9+
* - **Configuration Scope:**
10+
- :bdg-info:`Global`
11+
* - **Databricks Docs:**
12+
- NA
13+
14+
Framework-level settings (global JSON/YAML, substitutions, secrets, spec mappings, operational metadata) live under **one** active directory. The framework chooses between a **default** tree and an optional **override** tree; everything else reads paths relative to that choice.
15+
16+
Configuration
17+
-------------
18+
19+
| **Scope: Global (framework bundle)**
20+
| **Default:** ``./config/default/`` (for example ``src/config/default/`` when the framework root is ``src``).
21+
| **Override:** ``./config/override/`` (for example ``src/config/override/``). Optional; see **Override** below.
22+
23+
Under the active directory you normally have:
24+
25+
* exactly one global file: ``global.json``, ``global.yaml``, or ``global.yml``
26+
* a ``dataflow_spec_mapping/`` directory (see :doc:`feature_versioning_dataflow_spec`)
27+
* optional per-target substitution and secrets files (see :doc:`feature_substitutions`, :doc:`feature_secrets`)
28+
* optional ``operational_metadata_<layer>.json`` (see :doc:`feature_operational_metadata`)
29+
30+
Mandatory
31+
---------
32+
33+
* **Global file:** exactly one of ``global.json``, ``global.yaml``, ``global.yml``. More than one is an error.
34+
* **Mappings:** the ``dataflow_spec_mapping/`` directory must exist.
35+
36+
Optional
37+
--------
38+
39+
Inside the global file, all top-level keys are optional. Common ones:
40+
41+
.. list-table::
42+
:header-rows: 1
43+
:widths: 30 70
44+
45+
* - Key
46+
- See
47+
* - ``pipeline_bundle_spec_format``
48+
- :doc:`feature_spec_format`
49+
* - ``mandatory_table_properties``
50+
- :doc:`feature_mandatory_table_properties`
51+
* - ``spark_config``
52+
- :doc:`feature_spark_configuration`
53+
* - ``table_migration_state_volume_path``
54+
- :doc:`feature_table_migration`
55+
* - ``dataflow_spec_version``
56+
- :doc:`feature_versioning_dataflow_spec`
57+
* - ``override_max_workers`` / ``pipeline_builder_disable_threading``
58+
- :doc:`feature_builder_parallelization`
59+
60+
Override
61+
--------
62+
63+
* If ``./config/override/`` has **no** non-hidden files (only names starting with ``.``, such as ``.gitkeep``), the framework uses ``./config/default/``.
64+
* If it has **any** non-hidden file or folder, the framework uses ``./config/override/`` instead—but then that directory must already contain **both** a valid global file and a ``dataflow_spec_mapping/`` directory. Otherwise startup fails with a message to copy the full layout from ``./config/default/``.
65+
* If **neither** directory has non-hidden content, startup fails: add configuration under ``./config/default/``.
66+
67+
.. tip::
68+
69+
Leave ``config/override`` empty until you can mirror the whole ``config/default`` tree.

docs/source/feature_mandatory_table_properties.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Configuration
1717
-------------
1818

1919
| **Scope: Global**
20-
| Mandatory table properties are defined in the global configuration file located at ``src/config/global.json|yaml`` under the ``mandatory_table_properties`` section.
20+
| Mandatory table properties are defined in the global configuration file located at ``src/config/default/global.json|yaml`` under the ``mandatory_table_properties`` section.
2121
2222
Configuration Schema
2323
------------------

docs/source/feature_operational_metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Configuration
2929
-------------
3030

3131
| **Scope: Global**
32-
| In the Framework bundle, operational metadata columns are defined in JSON configuration files at Lakehouse layer level (e.g. bronze, silver, gold). The configuration files are locate at and must be named as follows: ``src/config/operational_metadata_<layer>.json``
32+
| In the Framework bundle, operational metadata columns are defined in JSON configuration files at Lakehouse layer level (e.g. bronze, silver, gold). The configuration files are locate at and must be named as follows: ``src/config/default/operational_metadata_<layer>.json``
3333
3434
.. admonition:: Layer Config
3535
:class: note

docs/source/feature_spark_configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Configuration
1717
-------------
1818

1919
| **Scope: Global**
20-
| In the Framework bundle, Spark configurations are defined in the global configuration file located at: ``src/config/global.json|yaml`` under the ``spark_config`` section.
20+
| In the Framework bundle, Spark configurations are defined in the global configuration file located at: ``src/config/default/global.json|yaml`` under the ``spark_config`` section.
2121
2222
| **Scope: Bundle**
2323
| In a Pipeline bundle, Spark configurations are defined in the global configuration file located at: ``src/pipeline_configs/global.json|yaml`` under the ``spark_config`` section.

docs/source/feature_spec_format.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Framework-Level Configuration
4040
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4141

4242
| **Scope: Framework**
43-
| The global specification format is defined in the Framework's global configuration file: ``src/config/global.json|yaml``
43+
| The global specification format is defined in the Framework's global configuration file: ``src/config/default/global.json|yaml``
4444
4545
.. tabs::
4646

@@ -235,7 +235,7 @@ Configuration Examples
235235
Example 1: Framework Enforces JSON Format
236236
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237237

238-
**Framework Configuration** (``src/config/global.json|yaml``):
238+
**Framework Configuration** (``src/config/default/global.json|yaml``):
239239

240240
.. tabs::
241241

@@ -263,7 +263,7 @@ Example 1: Framework Enforces JSON Format
263263
Example 2: Framework Allows Format Flexibility
264264
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
265265

266-
**Framework Configuration** (``src/config/global.json|yaml``):
266+
**Framework Configuration** (``src/config/default/global.json|yaml``):
267267

268268
.. tabs::
269269

@@ -312,7 +312,7 @@ Example 2: Framework Allows Format Flexibility
312312
Example 3: Framework Defaults to YAML
313313
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
314314

315-
**Framework Configuration** (``src/config/global.json|yaml``):
315+
**Framework Configuration** (``src/config/default/global.json|yaml``):
316316

317317
.. tabs::
318318

docs/source/feature_substitutions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Configuration
3535
-------------
3636

3737
| **Scope: Global**
38-
| In the Framework bundle, substitutions are defined in the following configuration file: ``src/config/<deployment environment/target>_substitutions.json|yaml``
39-
| e.g. ``src/config/dev_substitutions.json|yaml``
38+
| In the Framework bundle, substitutions are defined in the following configuration file: ``src/config/default/<deployment environment/target>_substitutions.json|yaml``
39+
| e.g. ``src/config/default/dev_substitutions.json|yaml``
4040
4141
| **Scope: Pipeline**
4242
| In a Pipeline bundle, substitutions are defined in the following configuration file: ``src/pipeline_configs/<deployment environment/target>_substitutions.json|yaml``

docs/source/feature_table_migration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Set as an attribute when creating your Data Flow Spec, refer to the :doc:`datafl
4040

4141
**Required Global Configuration**
4242

43-
When table migration is enabled, you must specify the volume path for checkpoint state storage in your ``global.json|yaml`` configuration file at either the framework level (``src/config/global.json|yaml``) or pipeline bundle level (``src/pipeline_configs/global.json|yaml``):
43+
When table migration is enabled, you must specify the volume path for checkpoint state storage in your ``global.json|yaml`` configuration file at either the framework level (``src/config/default/global.json|yaml``) or pipeline bundle level (``src/pipeline_configs/global.json|yaml``):
4444

4545
.. tabs::
4646

docs/source/feature_versioning_dataflow_spec.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The versioning system applies transformation mappings that can rename fields, mo
2727
Mapping File Structure
2828
----------------------
2929
DataFlow specification mappings are stored in version-specific directories under:
30-
``src/config/dataflow_spec_mapping/[version]/dataflow_spec_mapping.json``
30+
``src/config/default/dataflow_spec_mapping/[version]/dataflow_spec_mapping.json``
3131

3232
Each mapping file contains transformation rules organized by:
3333

@@ -242,7 +242,7 @@ Best Practices
242242
Version Management
243243
------------------
244244
1. Mapping versions should follow semantic versioning (MAJOR.MINOR.PATCH)
245-
2. Each mapping version should be stored in its own directory under ``src/config/dataflow_spec_mapping/``
245+
2. Each mapping version should be stored in its own directory under ``src/config/default/dataflow_spec_mapping/``
246246
3. Maintain documentation of what each version transforms and why
247247
4. Keep mapping files immutable once deployed to ensure consistency
248248
5. Create new mapping versions rather than modifying existing ones

docs/source/features.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Framework Features
1111
feature_data_quality_expectations
1212
feature_data_quality_quarantine
1313
feature_direct_publishing_mode
14+
feature_framework_configuration
1415
feature_liquid_clustering
1516
feature_logging
1617
feature_logical_environment

0 commit comments

Comments
 (0)