Skip to content

Conversation

@shayne-fletcher
Copy link
Contributor

Summary:
this diff follows up on mariusae's comment in D87795973 and completes the cleanup he hinted at. the main change is to make the Python-owned "Runtime" layer an explicit, coherent concept throughout the module. the Rust helpers are renamed (*_py, configure_kwarg, etc.) so their roles are unambiguous, and the documentation now reflects the actual data flow: configure(**kwargs) writes only into Source::Runtime, while get_global_config and get_runtime_config clearly separate merged vs. layer-local views.

on the Python side, the API surface is aligned with these semantics. the configured(...) context manager (the 'test_config.py' version) is rewritten to snapshot and restore only the Runtime layer instead of resetting global config, which makes overrides composable while continuing to prevent state leakage across tests. the .pyi file is updated to document the layered model and the historical naming of configure(...).

this diff further formalizes the contract implied by the earlier code: Python exclusively owns the Runtime layer, and all read/write paths now reflect that consistently in naming, behavior, and documentation.

Differential Revision: D87866946

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 25, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 25, 2025

@shayne-fletcher has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87866946.

shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 25, 2025
Summary:

this diff follows up on mariusae's [comment in D87795973](https://www.internalfb.com/diff/D87795973?dst_version_fbid=861202266855169&transaction_fbid=1244851620803763) and completes the cleanup he hinted at. the main change is to make the Python-owned "Runtime" layer an explicit, coherent concept throughout the module. the Rust helpers are renamed (`*_py`, `configure_kwarg`, etc.) so their roles are unambiguous, and the documentation now reflects the actual data flow: `configure(**kwargs)` writes only into `Source::Runtime`, while `get_global_config` and `get_runtime_config` clearly separate merged vs. layer-local views.

on the Python side, the API surface is aligned with these semantics. the `configured(...)` context manager (the 'test_config.py' version) is rewritten to snapshot and restore only the Runtime layer instead of resetting global config, which makes overrides composable while continuing to prevent state leakage across tests. the .pyi file is updated to document the layered model and the historical naming of `configure(...)`.

this diff further formalizes the contract implied by the earlier code: Python exclusively owns the Runtime layer, and all read/write paths now reflect that consistently in naming, behavior, and documentation.

Differential Revision: D87866946
Summary:

this diff follows up on mariusae's [comment in D87795973](https://www.internalfb.com/diff/D87795973?dst_version_fbid=861202266855169&transaction_fbid=1244851620803763) and completes the cleanup he hinted at. the main change is to make the Python-owned "Runtime" layer an explicit, coherent concept throughout the module. the Rust helpers are renamed (`*_py`, `configure_kwarg`, etc.) so their roles are unambiguous, and the documentation now reflects the actual data flow: `configure(**kwargs)` writes only into `Source::Runtime`, while `get_global_config` and `get_runtime_config` clearly separate merged vs. layer-local views.

on the Python side, the API surface is aligned with these semantics. the `configured(...)` context manager (the 'test_config.py' version) is rewritten to snapshot and restore only the Runtime layer instead of resetting global config, which makes overrides composable while continuing to prevent state leakage across tests. the .pyi file is updated to document the layered model and the historical naming of `configure(...)`.

this diff further formalizes the contract implied by the earlier code: Python exclusively owns the Runtime layer, and all read/write paths now reflect that consistently in naming, behavior, and documentation.

Reviewed By: dulinriley

Differential Revision: D87866946
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 26, 2025
Summary:

this diff follows up on mariusae's [comment in D87795973](https://www.internalfb.com/diff/D87795973?dst_version_fbid=861202266855169&transaction_fbid=1244851620803763) and completes the cleanup he hinted at. the main change is to make the Python-owned "Runtime" layer an explicit, coherent concept throughout the module. the Rust helpers are renamed (`*_py`, `configure_kwarg`, etc.) so their roles are unambiguous, and the documentation now reflects the actual data flow: `configure(**kwargs)` writes only into `Source::Runtime`, while `get_global_config` and `get_runtime_config` clearly separate merged vs. layer-local views.

on the Python side, the API surface is aligned with these semantics. the `configured(...)` context manager (the 'test_config.py' version) is rewritten to snapshot and restore only the Runtime layer instead of resetting global config, which makes overrides composable while continuing to prevent state leakage across tests. the .pyi file is updated to document the layered model and the historical naming of `configure(...)`.

this diff further formalizes the contract implied by the earlier code: Python exclusively owns the Runtime layer, and all read/write paths now reflect that consistently in naming, behavior, and documentation.

Reviewed By: dulinriley

Differential Revision: D87866946
@shayne-fletcher shayne-fletcher force-pushed the export-D87866946 branch 2 times, most recently from 97f59d7 to ac9e124 Compare November 26, 2025 21:35
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 26, 2025
Summary:

this diff follows up on mariusae's [comment in D87795973](https://www.internalfb.com/diff/D87795973?dst_version_fbid=861202266855169&transaction_fbid=1244851620803763) and completes the cleanup he hinted at. the main change is to make the Python-owned "Runtime" layer an explicit, coherent concept throughout the module. the Rust helpers are renamed (`*_py`, `configure_kwarg`, etc.) so their roles are unambiguous, and the documentation now reflects the actual data flow: `configure(**kwargs)` writes only into `Source::Runtime`, while `get_global_config` and `get_runtime_config` clearly separate merged vs. layer-local views.

on the Python side, the API surface is aligned with these semantics. the `configured(...)` context manager (the 'test_config.py' version) is rewritten to snapshot and restore only the Runtime layer instead of resetting global config, which makes overrides composable while continuing to prevent state leakage across tests. the .pyi file is updated to document the layered model and the historical naming of `configure(...)`.

this diff further formalizes the contract implied by the earlier code: Python exclusively owns the Runtime layer, and all read/write paths now reflect that consistently in naming, behavior, and documentation.

Reviewed By: dulinriley

Differential Revision: D87866946
@meta-codesync meta-codesync bot closed this in e91c0c4 Nov 26, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 26, 2025

This pull request has been merged in e91c0c4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants