Add documentation for prefect sdk generate CLI#1
Conversation
- Add auto-generated CLI reference for `prefect sdk` command - Add how-to guide for generating typed SDKs from deployments - Update navigation in docs.json for both new pages - Regenerate CLI docs to include new --output options Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep only sdk.mdx from the CLI docs regeneration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The code examples reference a hypothetical my_sdk module that doesn't exist, so they can't be executed as tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove marketing-style "before/after" section - Use sentence case headers - Task-oriented organization (CLI then Python) - Add opening context and further reading links - Direct, instructional tone throughout Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove marketing-style "before/after" section - Use sentence case headers - Task-oriented organization (CLI then Python) - Add opening context and further reading links - Direct, instructional tone throughout Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move generate-custom-sdk.mdx to docs/v3/advanced/ - Create new "Deployments" group in Advanced section - Move form-building guide to new Deployments group - Both guides relate to deployment configuration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37e272dd3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Logger for SDK fetcher operations | ||
| logger = logging.getLogger(__name__) |
There was a problem hiding this comment.
Use Prefect get_logger for SDK fetcher
This introduces a logger via logging.getLogger, which bypasses Prefect’s configured logging stack and violates the repository rule (AGENTS.md §3) that requires logger: "logging.Logger" = get_logger("module_name"). In practice, this can lead to missing structured context/handlers and inconsistent log levels for SDK fetcher diagnostics. Please switch to get_logger with the standard type annotation to keep logging behavior consistent across the SDK.
Useful? React with 👍 / 👎.
| job_vars_schema: dict[str, Any] = {} | ||
| base_job_template = work_pool.base_job_template | ||
| if base_job_template and "variables" in base_job_template: | ||
| variables = base_job_template["variables"] | ||
| if isinstance(variables, dict): | ||
| job_vars_schema = variables | ||
| job_vars_schema = base_job_template["variables"] |
There was a problem hiding this comment.
Preserve dict guard for work pool variables schema
Removing the isinstance guard means job_vars_schema can now be set to any non-dict value that the API returns in base_job_template["variables"]. If that happens (e.g., older server versions or malformed work pool templates), _process_work_pool in src/prefect/_sdk/renderer.py calls schema.get(...) and will raise AttributeError, aborting SDK generation. Keeping the dict check or coercing to {} preserves the previous defensive behavior and avoids a runtime crash on non-dict payloads.
Useful? React with 👍 / 👎.
Benchmark PR from agentic-review-benchmarks#1