sha174n opened a new pull request, #44078:
URL: https://github.com/apache/superset/pull/44078

   ### SUMMARY
   
   `Database._get_sqla_engine` calls 
`db_engine_spec.adjust_engine_params(...)`, which **returns a new 
`connect_args` dict** — the base implementation builds `{**connect_args, 
**enforce_uri_query_params}` — but the return value was discarded and the 
original `connect_args` was passed to `create_engine`.
   
   As a result, any `connect_args` entry that a spec contributes through 
`adjust_engine_params` was silently dropped. The clearest case is the MySQL 
specs, whose `enforce_uri_query_params` (`{"local_infile": 0}` for mysqldb, 
`{"allow_local_infile": 0}` for mysqlconnector) never actually reached the 
driver.
   
   The fix writes the returned dict back into `engine_kwargs["connect_args"]`. 
Specs that mutate `connect_args` in place (e.g. trino's `source`) are 
unaffected, since the base merge preserves existing keys.
   
   ### TESTING INSTRUCTIONS
   
   `pytest tests/unit_tests/models/core_test.py -k get_sqla_engine`
   
   Adds `test_get_sqla_engine_honors_adjusted_connect_args`, which asserts the 
enforced MySQL param reaches `create_engine`. Existing `test_get_sqla_engine` 
(trino `source` path) still passes.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [x] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to