File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -359,11 +359,30 @@ def _build_request_body(
359359
360360 expanded_json = {}
361361
362- # Expand dotted keys into nested dictionaries
362+ # Keys under `engine_config.pg` that should stay flat at one level deep
363+ flat_pg_keys = {
364+ "pg_partman_bgw.interval" ,
365+ "pg_partman_bgw.role" ,
366+ "pg_stat_monitor.pgsm_enable_query_plan" ,
367+ "pg_stat_monitor.pgsm_max_buckets" ,
368+ "pg_stat_statements.track" ,
369+ }
370+
363371 for k , v in vars (parsed_args ).items ():
364372 if v is None or k in param_names :
365373 continue
366374
375+ # If the key starts with the prefix "engine_config.pg" and is one
376+ # of the keys to remain flat, do not nest
377+ if k .startswith ("engine_config.pg." ):
378+ remainder = k [len ("engine_config.pg." ) :]
379+ if remainder in flat_pg_keys :
380+ expanded_json .setdefault ("engine_config" , {}).setdefault (
381+ "pg" , {}
382+ )[remainder ] = v
383+ continue
384+
385+ # Expand dotted keys into nested dictionaries (default)
367386 cur = expanded_json
368387 for part in k .split ("." )[:- 1 ]:
369388 if part not in cur :
You can’t perform that action at this time.
0 commit comments