You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2026/08/23 17:57:34 UTC
[PR] feat(coordination): accept a callable key generator in the KV API [superset]
villebro opened a new pull request, #43435:
URL: https://github.com/apache/superset/pull/43435
### SUMMARY
Small, additive ergonomics improvement to the coordination service, part of the [GAQ→GTF epic](https://github.com/apache/superset/pull/43407) (targets `gaq-to-gtf`).
`CoordinationService.get_value` / `set_value` / `delete_value` previously took a plain `key: str`, so every caller had to build the key string eagerly. For parity with Superset's other cache-key helpers (e.g. `memoized_func(key=...)`), the KV ops now also accept a `() -> str` **key generator**, resolved at call time via a shared `_resolve_key` helper. A literal string still passes through unchanged, so the change is backward-compatible and purely additive; `delete_value(*keys)` accepts a mix of literals and generators.
```python
KeyLike = Union[str, Callable[[], str]]
```
A generator that returns a non-string raises `TypeError` (fail fast, before touching the backend).
**Scope note:** this is intentionally limited to the general-purpose coordinator KV. The GTF **`task_key` stays a fixed literal** — it is the dedup identity resolved synchronously at submit time (it feeds the dedup lock + `dedup_key`), so it must not become callable/mutable.
### TESTING INSTRUCTIONS
- `pytest tests/unit_tests/coordination/test_service.py tests/unit_tests/distributed_lock/` — 27 passed. New coverage: a callable key resolved per-op for get/set/delete (incl. a literal+callable mix), and the non-string-key `TypeError` guard.
- `mypy` / `ruff` / `pylint` clean on changed files.
- Backward compatibility: existing string-key callers (the distributed lock) unchanged and green.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] 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
- [x] 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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(coordination): accept a callable key generator in the KV API [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43435:
URL: https://github.com/apache/superset/pull/43435#issuecomment-5387587688
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(coordination): accept a callable key generator in the KV API [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #43435:
URL: https://github.com/apache/superset/pull/43435
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(coordination): accept a callable key generator in the KV API [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #43435:
URL: https://github.com/apache/superset/pull/43435#issuecomment-5387668354
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/43435?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `45.45455%` with `6 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 65.99%. Comparing base ([`5719f04`](https://app.codecov.io/gh/apache/superset/commit/5719f048c0cd7ca7bfcac37a8a9275fd6b69945e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`c6cc291`](https://app.codecov.io/gh/apache/superset/commit/c6cc291ade1b3bdd93659b8e2878d97ec1b09ed4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 2 commits behind head on gaq-to-gtf.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/43435?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [superset/coordination/base.py](https://app.codecov.io/gh/apache/superset/pull/43435?src=pr&el=tree&filepath=superset%2Fcoordination%2Fbase.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29vcmRpbmF0aW9uL2Jhc2UucHk=) | 45.45% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (5719f04) and HEAD (c6cc291). Click for more details.
>
> <details><summary>HEAD has 3 uploads less than BASE</summary>
>
>| Flag | BASE (5719f04) | HEAD (c6cc291) |
>|------|------|------|
>|python|6|3|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## gaq-to-gtf #43435 +/- ##
===============================================
- Coverage 78.84% 65.99% -12.85%
===============================================
Files 2880 2880
Lines 164425 164459 +34
Branches 37995 38003 +8
===============================================
- Hits 129636 108541 -21095
- Misses 32346 53727 +21381
+ Partials 2443 2191 -252
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.13% <45.45%> (-0.02%)` | :arrow_down: |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.07% <45.45%> (-0.02%)` | :arrow_down: |
| [python](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.54% <45.45%> (-25.98%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.41% <45.45%> (-0.03%)` | :arrow_down: |
| [unit](https://app.codecov.io/gh/apache/superset/pull/43435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/43435?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(coordination): accept a callable key generator in the KV API [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #43435:
URL: https://github.com/apache/superset/pull/43435#issuecomment-5387596099
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | c6cc291ade1b3bdd93659b8e2878d97ec1b09ed4 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a8b348fdad2ae00082f6e94 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-43435--superset-docs-preview.netlify.app](https://deploy-preview-43435--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DctRCoAgDADQu-w7SUrCukHHmG6RtJxIBBHdPf_ez3uhVD3LBQtAB6FijnvznUQ4VO2jaqWU8UqazXGbiCIYhM3BTwvERfRZqZUJfRid3whpQLbW-mGbeHbw_Q) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-43435--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org