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 UniqueList annotated type #1815

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Add UniqueList annotated type #1815

merged 2 commits into from
Apr 16, 2024

Conversation

JimMadge
Copy link
Member

✅ Checklist

  • You have given your pull request a meaningful title (e.g. Enable foobar integration rather than 515 foobar).
  • You are targeting the appropriate branch. If you're not certain which one this is, it should be develop.
  • Your branch is up-to-date with the target branch (it probably was when you started, but it may have changed since then).
  • You have marked this pull request as a draft and added '[WIP]' to the title if needed (if you're not yet ready to merge).

⤴️ Summary

🌂 Related issues

Closes #1721

🔬 Tests

Copy link
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

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

LGTM. One question about how the type definition works.

data_safe_haven/utility/annotated_types.py Show resolved Hide resolved
@JimMadge JimMadge marked this pull request as ready for review April 16, 2024 10:45
@JimMadge JimMadge requested a review from a team as a code owner April 16, 2024 10:45
@jemrobinson
Copy link
Member

Given that a UniqueList is actually a set() could/should we be using set everywhere instead?

@JimMadge
Copy link
Member Author

Given that a UniqueList is actually a set() could/should we be using set everywhere instead?

That is a good question. I think we don't want to do that here because we are parsing user input. If they provide an invalid input, we should raise an error rather than trying to fix it. set would remove duplicates rather than raising an exception.

@JimMadge JimMadge merged commit 09de44b into develop Apr 16, 2024
10 checks passed
@JimMadge JimMadge deleted the unique_list_validator branch April 16, 2024 12:39
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.

Pulumi: Use an Annotated Container Type for validation
2 participants