LALITH0110 opened a new pull request, #43630:
URL: https://github.com/apache/superset/pull/43630
### SUMMARY
Five docstring entries name parameters that their functions do not accept, so
Sphinx documents arguments a caller cannot pass. Each was checked against the
function signature before changing.
**`superset/migrations/shared/constraints.py`** — `redefine()`:
- The `foreign_key` entry uses the `:params` directive instead of `:param`,
so it
is not rendered as a parameter at all. This is the **only** `:params` in
`superset/`, against 1389 correct `:param` uses, so it is a typo rather
than a
local convention.
- The same docstring documents `ondelete` and `onupdate`, but the parameters
are
`on_delete` and `on_update`.
**`superset/cli/viz_migrations.py`** — `migrate_by_id()` documents `id`; the
parameter is `ids`. The entry's own text ("Tuple of chart IDs to migrate")
already
describes the plural.
**`superset/utils/screenshots.py`** — `compute_and_cache()` documents
`cache`,
which is not a parameter; the cache itself is `self.cache`. The real
parameter is
`cache_key`, used for the cache lookup and as the `DistributedLock` key, and
it was
undocumented. The entry is relabelled to `cache_key` and its description
corrected
to describe the key rather than the cache — keeping the old wording under
the new
name would have read as accurate while being wrong.
Scope is deliberately narrow: parameters that were never documented are left
undocumented rather than newly described, and no wording changes beyond what
the
incorrect names require. Docstring-only; no behaviour change.
This is the same class of defect as #42646, found the same way.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable — no UI or rendered-output change.
### TESTING INSTRUCTIONS
Docstring-only, so there is no behaviour to exercise. Correctness is
verifiable by
reading each signature against its docstring:
```
superset/migrations/shared/constraints.py:39 redefine(foreign_key,
on_delete, on_update)
superset/cli/viz_migrations.py:159 migrate_by_id(ids,
is_downgrade)
superset/utils/screenshots.py:324 compute_and_cache(force,
user, window_size, thumb_size, cache_key)
```
Per `AGENTS.md`, `pre-commit` was run on the changed files before pushing,
using the
pinned `ruff==0.9.7` from `requirements/development.txt`. All applicable
hooks pass:
`mypy`, `ruff`, `ruff-format`, `pylint` (with the custom Superset plugins),
`auto-walrus`, `check-docstring-first`, `Blacklist`, and the whitespace/EOF
hooks.
### 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
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Note on the migrations file: `constraints.py` is a shared helper used *by*
migrations, not a migration script itself, and only its docstring is touched
— no
DB migration is introduced.
--
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]