docs: gate new @available methods behind portable alternatives - #1625
Merged
Conversation
Every `@available` method is permanent public API — Jinja is late-bound, so nothing warns that one is unused — and each must be re-implemented in the Fusion engine's Rust adapter (dispatch plus semantic classification) before Databricks behavior matches across engines. Macros built on the shared adapter contract inherit that machinery instead. Replace the "Adding New Adapter Method" steps with an ordered list that an agent works down, stopping at the first option that works: an existing shared-contract macro, plain Jinja expressions, a relation config component, and only then a new `@available` method. Reaching the last step now asks for a justification in the PR description, portable types in the signature, and an acknowledgement that Fusion parity work is owed. Add matching entries to Code Patterns to Follow and Common Pitfalls for Agents, which are the sections agents actually consult mid-task.
Collaborator
Author
|
@xuliangs FYI |
sd-db
marked this pull request as ready for review
August 7, 2026 14:28
sd-db
enabled auto-merge (squash)
August 9, 2026 06:14
jprakash-db
approved these changes
Aug 10, 2026
xuliangs
reviewed
Aug 10, 2026
| 9. **Use capability system for version checks** - Never add new `compare_dbr_version()` calls | ||
| 10. **Remember per-compute caching** - Different clusters may have different capabilities in the same run | ||
| 11. **Multi-statement SQL**: Don't use semicolons to separate statements - return a list instead and let `execute_multiple_statements()` handle it | ||
| 12. **Don't add an `@available` method for logic Jinja can already do** - each one is permanent API and owes a matching Fusion implementation. Check the shared adapter contract first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gate new
@availablemethods behind portable alternatives in the agent guide.Each
@availablemethod is permanent public API — Jinja is late-bound, so nothing flags an unused one — and must be re-implemented in the Fusion engine's Rust adapter before behavior matches across engines. Shared-contract macros get that for free.### Adding New Adapter Methodnow opens with that cost, then lists options to work down, stopping at the first that works: a shared-contract macro, plain Jinja, a relation config component, and only then a new@availablemethod. Reaching the last step asks for a justification, portable types, and an acknowledgement that Fusion parity is owed.Shorter entries added to
### Code Patterns to Followand### Common Pitfalls for Agents.Test plan
Docs only — no runtime change, no CHANGELOG entry, no tests.
pre-commit run --all-filespasses.