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

[AutoPR] TODO migrate to pydantic 2.0, and use a nested sel ... #130

Open
github-actions bot opened this issue Nov 5, 2023 · 0 comments
Open

[AutoPR] TODO migrate to pydantic 2.0, and use a nested sel ... #130

github-actions bot opened this issue Nov 5, 2023 · 0 comments
Labels

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2023

TODO migrate to pydantic 2.0, and use a nested self-referential Union like this:

# supports jinja2 templates like `{{ pull_request.title }}`
TemplateString = str
# supports jinja2 templates in nested dicts/lists
TemplateObject = Union[TemplateString, dict[str, Any], list[Any]]
# TODO migrate to pydantic 2.0, and use a nested self-referential Union like this:
# TemplateObject = Union[TemplateString, dict[str, "TemplateObject"], list["TemplateObject"]]
class ContextDict(dict[ContextVarName, Any]):
def get_path(self, path: ContextVarPath) -> Any:

To resolve this TODO, you can start by updating the code to use the latest version of pydantic (2.0). Then, you can implement a nested self-referential Union, following the example provided.

@github-actions github-actions bot added the medium label Nov 5, 2023
pull bot pushed a commit to TheRakeshPurohit/AutoPR that referenced this issue Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants