Skip to content

Add documentation for prefect sdk generate CLI#1

Open
tomerqodo wants to merge 8 commits intocodex_full_base_add_documentation_for_prefect_sdk_generate_cli_pr1from
codex_full_head_add_documentation_for_prefect_sdk_generate_cli_pr1
Open

Add documentation for prefect sdk generate CLI#1
tomerqodo wants to merge 8 commits intocodex_full_base_add_documentation_for_prefect_sdk_generate_cli_pr1from
codex_full_head_add_documentation_for_prefect_sdk_generate_cli_pr1

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#1

desertaxle and others added 8 commits January 25, 2026 12:09
- 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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +19 to +20
# Logger for SDK fetcher operations
logger = logging.getLogger(__name__)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines 179 to +182
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"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

2 participants