Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting to exclude traversal of Pydantic models in parameters #8763

Closed
wants to merge 1 commit into from

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Mar 9, 2023

Addresses concerns raised in #8542 by allowing Pydantic model traversal to be disabled so they are not copied during visits. We could introduce a setting like this for dataclasses as well.

@zanieb zanieb added the enhancement An improvement of an existing feature label Mar 9, 2023
@netlify
Copy link

netlify bot commented Mar 9, 2023

Deploy Preview for prefect-docs ready!

Name Link
🔨 Latest commit 298ca4a
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs/deploys/640a2e132fd4c40008b7cd46
😎 Deploy Preview https://deploy-preview-8763--prefect-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@@ -29,6 +29,8 @@

import pydantic

from prefect.settings import PREFECT_PARAMETERS_TRAVERSE_PYDANTIC_MODELS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems like it ought to live in the engine and visit_collection should take a set of types to exclude traversal of. However, it's simpler to put it here and I'm not sure how much the purity matters.

@@ -594,6 +594,16 @@ def default_cloud_ui_url(settings, value):
flow and task results will be persisted unless they opt out.
"""

PREFECT_PARAMETERS_TRAVERSE_PYDANTIC_MODELS = Setting(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I love this name.

@zanieb
Copy link
Contributor Author

zanieb commented Mar 21, 2023

Deferring this in favor of explicitly using quote for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant