Read flow parameter schemas from source without running it #117
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"7bf1d1ecf7c4b451950d07c91902751b093424db","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-24T17:18:56.492240Z">2026-11-24T17:18:56.492240Z</relative-time> | 7bf1d1e | PR opened |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
<sub><sub>!P2 Badge</sub></sub> Preserve enum members whose value is None
When a source enum legitimately declares a member such as UNSET = None, _try_evaluate successfully returns None, but this condition treats that value as an evaluation failure and omits the member. Any flow parameter using that enum then receives a schema without the null choice, and a default such as Status.UNSET can no longer be resolved from the rebuilt enum. Use a distinct sentinel for failed evaluation so valid None-valued members remain in the schema.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bf1d1ecf7
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
</details>
Fixed in https://github.com/PrefectHQ/prefect-cloud/commit/06d085216ecb3c59656cfc096effc2e51679e1ab: enum members are now skipped only when their value can't be evaluated, so UNSET = None is kept, with a test.
---
Posted by Claude Opus 5.5 on behalf of @chrisguidry.
<!-- monitor-pr -->
Approved these changes.
zangell44
chrisguidry
prefect-cloud deploy --from owner/repodownloads the flow file from GitHub and builds its parameter schema from the source. To do that it ranexecon every top-level class, function, and assignment in the file andevalon each parameter annotation and default, so deploying a repository ran that repository's module-level code on the deploying machine, with the user's Prefect and GitHub credentials.The schema is now read statically. The file's absolute imports still resolve against installed modules, enum and pydantic model classes are rebuilt from their declarations, and annotations and defaults go through a small evaluator that allows literals, names, public attributes, subscripts,
|, and calls to value constructors likedatetime.dateandpydantic.Field. Anything else is treated as unknown, as failed evaluation was before: annotations fall back to untyped and defaults toNone. Models built by calling a function, such ascreate_model(...), are now untyped in the schema. This also pinsastral-sh/setup-uvto a commit SHA.🤖 Generated with Claude Code
https://claude.ai/code/session_01KgFwsYjZswhNsDNRNKw1Ej