Skip to content

Include COALESCE in interactive function help - #292

Closed
ryanduguid wants to merge 2 commits into
beancount:masterfrom
ryanduguid:fix/coalesce-help
Closed

ryanduguid wants to merge 2 commits into
beancount:masterfrom
ryanduguid:fix/coalesce-help

Conversation

@ryanduguid

@ryanduguid ryanduguid commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

Include COALESCE in .help targets, .help from and .help where through a documentation stub in query_env.py, following the existing function registry pattern. The compiler evaluates it through EvalCoalesce; its docstring describes multiple arguments, NULL handling and the common-type requirement.

Closes #284.

Evidence

  • The help regression lists coalesce(any) once in each topic, outside the aggregate section.
  • On Linux with Python 3.11.16 and Beancount 3.2.3, all 294 tests, Ruff, both 100% parser and renderer coverage gates, source distribution and wheel builds pass.
  • Reuse the five function-specific Ruff PLR0917 annotations from Report invalid source schemes as OperationalError #296 for the established renderer and command signatures. The new Ruff release otherwise flags these unchanged signatures.
  • Fork CI completed all 24 checks at 2a715f1, with deployment skipped and no failures.

Merge danger

Door: reversible. Blast radius: interactive help.

COALESCE appears through the same registry as the other documented functions.

Unverified

Upstream checks and maintainer review remain outstanding. The Windows full suite has three temporary-file handle errors and one CSV newline failure. Aikido could not connect, so its scan is unverified.

@ryanduguid
ryanduguid marked this pull request as ready for review September 26, 2026 04:35
Comment thread beanquery/shell.py Outdated
Comment on lines +709 to +713
entries.append((
'coalesce',
'Return the first non-NULL argument, or NULL if all arguments are NULL. '
'Arguments must have the same type.',
'expr, ...'))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special casing coalesce like this is not the way to go. Other similar cases are solved adding a function stub.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the shell special case with a query_env.coalesce documentation stub using the existing @function pattern. Its docstring records the multiple-argument and common-type requirements; compilation uses EvalCoalesce. All 294 tests, Ruff, both coverage gates and the package builds pass on Linux with Python 3.11 and Beancount 3.2.3.

@dnicolodi dnicolodi closed this Oct 2, 2026
@ryanduguid

Copy link
Copy Markdown
Author

Upstream CI expired while waiting for workflow approval. The test run created no jobs and reports: "This workflow run required approval but was not approved before it expired." The updated branch passes all 23 fork checks, with deployment skipped. Please rerun and approve the upstream workflows for 2a715f1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The function COALESCE() is available, but is not displayed by the .help targets

2 participants