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

   ### SUMMARY
   
   Adds a custom `parameters_schema` to `AthenaEngineSpec` so Amazon Athena
   connections render the **new dynamic connection form** (individual, labeled
   fields) instead of the raw SQLAlchemy-URI box. Part of the epic to migrate DB
   connections to the dynamic form.
   
   Story: https://app.shortcut.com/preset/story/120994
   
   Athena's PyAthena URI is not a simple `host/port/user/pass/db`:
   
   ```
   
awsathena+rest://{aws_access_key_id}:{aws_secret_access_key}@athena.{region_name}.amazonaws.com/{schema_name}?s3_staging_dir={quoted}&work_group={work_group}
   ```
   
   so this follows the **custom-schema** pattern used by `bigquery`/`gsheets`/
   `snowflake` rather than `BasicParametersMixin`:
   
   - `AthenaParametersSchema` / `AthenaParametersType` with `aws_access_key_id`,
     `aws_secret_access_key`, `region_name`, `s3_staging_dir`, `schema_name` and
     optional `work_group`.
   - `build_sqlalchemy_uri` / `get_parameters_from_uri` round-trip. The secret 
is
     carried in the URI password position, so it is masked on read through the
     existing password-masking machinery (no `encrypted_extra` needed).
   - `parameters_json_schema`, `validate_parameters` (requires `region_name` +
     `s3_staging_dir`; credentials optional to allow IAM-role auth),
     `sqlalchemy_uri_placeholder` and `default_driver = "rest"`.
   
   The new fields are wired into the frontend dynamic connection form
   (`FormFieldOrder` / `FORM_FIELD_MAP` / `FIELD_TEXT_MAP` and the
   `DatabaseParameters` type) so they render as labeled inputs.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   _N/A — backend + form-field wiring; before this change Athena showed the raw
   SQLAlchemy URI box, after it shows the dynamic form fields._
   
   ### TESTING INSTRUCTIONS
   
   - `pytest tests/unit_tests/db_engine_specs/test_athena.py` — new tests cover
     `build_sqlalchemy_uri` (full + minimal), `get_parameters_from_uri`, the
     round-trip, non-standard hosts, `parameters_json_schema` and
     `validate_parameters`.
   - In the UI, add a database and select **Amazon Athena** — the dynamic form 
now
     renders AWS Access Key ID, AWS Secret Access Key, Region, S3 Staging
     Directory, Schema and Work Group fields.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Changes UI
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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