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

Allow measures to specify dummy data additional population constraint #2328

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

rebkwok
Copy link
Contributor

@rebkwok rebkwok commented Dec 19, 2024

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Dec 19, 2024

Deploying databuilder-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8bf2037
Status: ✅  Deploy successful!
Preview URL: https://dace3739.databuilder.pages.dev
Branch Preview URL: https://additional-pop-constraints-m.databuilder.pages.dev

View logs

Comment on lines 63 to 64
else:
self.additional_population_constraint = None
Copy link
Contributor

@madwort madwort Dec 19, 2024

Choose a reason for hiding this comment

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

do we need this branch? (the other branch tested for is not None, rather than e.g. for truthy)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I just blindly copied it from where it was before, but I think you're right, it'll always be None already here

Copy link
Contributor

@evansd evansd left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

Comment on lines 60 to 62
self.additional_population_constraint = (
self.additional_population_constraint._qm_node
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is quite right because now the "validate" method is changing the value of self.additional_population_constraint. So, for example, it will fail if you call it twice in a row.

I think you want to make it a set_additional_population_constraint() method which takes the value, validates it, and then updates the attribute if it's valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh that's how I did it first. Will change it back, hadn't considered calling it twice

@rebkwok rebkwok force-pushed the additional-pop-constraints-measures branch from 3059f5a to 8bf2037 Compare December 19, 2024 15:50
@rebkwok rebkwok merged commit 784d011 into main Dec 19, 2024
8 checks passed
@rebkwok rebkwok deleted the additional-pop-constraints-measures branch December 19, 2024 21:24
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.

3 participants