-
Notifications
You must be signed in to change notification settings - Fork 65
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
Block-level constraints #1124
Block-level constraints #1124
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
2d368aa
to
be27089
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to 1cbb5d0 in 2 minutes and 4 seconds
More details
- Looked at
4207
lines of code in45
files - Skipped
1
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. engine/baml-lib/jsonish/src/tests/mod.rs:134
- Draft comment:
Ensure thatir.distribute_constraints
is used instead ofFieldType::distribute_constraints
as the latter has been removed. This applies to other instances whereFieldType::distribute_constraints
was used. - Reason this comment was not posted:
Comment did not seem useful.
2. engine/baml-lib/baml-types/src/field_type/mod.rs:158
- Draft comment:
The comment aboutdistribute_constraints
is outdated since the function is removed. Consider removing or updating this comment to avoid confusion. - Reason this comment was not posted:
Confidence changes required:50%
The functiondistribute_constraints
is implemented twice, once inIRHelper
and once inFieldType
. The implementation inFieldType
is removed, but the comment explaining its purpose is still present. This could be confusing for future developers.
3. engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs:13
- Draft comment:
The functiondistribute_constraints
is implemented twice, once inIRHelper
and once inFieldType
. The implementation inFieldType
is removed, but the function is still called in some places. Ensure all calls are updated to use theIRHelper
implementation to avoid runtime errors. - Reason this comment was not posted:
Marked as duplicate.
4. engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs:377
- Draft comment:
Thedistribute_constraints
function does not handleFieldType::Tuple
. Consider adding a case for it to ensure all field types are covered. - Reason this comment was not posted:
Confidence changes required:50%
Thedistribute_constraints
function inbaml-lib/baml-core/src/ir/ir_helpers/mod.rs
is missing a check forFieldType::Tuple
. This could lead to unexpected behavior if tuples are used with constraints.
Workflow ID: wflow_6rxfaNbBmxbx0S3U
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
45923d8
to
daf1646
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on daf1646 in 1 minute and 1 seconds
More details
- Looked at
2927
lines of code in44
files - Skipped
1
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. integ-tests/typescript/tests/integ-tests.test.ts:746
- Draft comment:
Consider adding a test case for a successful block-level check scenario to ensure both success and failure cases are covered. - Reason this comment was not posted:
Confidence changes required:50%
The test case for 'constraints: should handle block-level checks' is correctly checking the status of the 'cross_field' check. However, it would be beneficial to add a test case for a successful scenario as well.
2. integ-tests/typescript/tests/integ-tests.test.ts:751
- Draft comment:
Consider adding a test case for a failed nested-block-level check scenario to ensure both success and failure cases are covered. - Reason this comment was not posted:
Confidence changes required:50%
The test case for 'constraints: should handle nested-block-level checks' is correctly checking the status of the 'cross_field' check. However, it would be beneficial to add a test case for a failure scenario as well.
Workflow ID: wflow_eh9Ps3Cpq8EZibSX
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on c470414 in 35 seconds
More details
- Looked at
96
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. fern/03-reference/baml/attributes/check.mdx:15
- Draft comment:
Add a BAML language identifier to the code block for consistency with other examples. - Reason this comment was not posted:
Confidence changes required:50%
The documentation update invalidations.mdx
andassert.mdx
files is consistent with the new feature of block-level constraints. However, thecheck.mdx
file also needs a similar update to reflect block-level checks.
Workflow ID: wflow_g7QflJs31pNzoCQu
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on d21f1aa in 41 seconds
More details
- Looked at
20
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. engine/baml-lib/parser-database/src/attributes/constraint.rs:24
- Draft comment:
Consider providing a more descriptive error message for invalid attribute names to aid debugging. - Reason this comment was not posted:
Confidence changes required:33%
The error message for invalid attribute names is being pushed to the context, which is a good practice for error handling. However, the message could be more descriptive to aid debugging.
Workflow ID: wflow_wV7hvrHPbUWE15jx
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Adds the ability to specify constraints on types at the block level, like this:
TODO:
Important
Adds block-level constraints for types, updates constraint handling logic, and includes integration tests for the new functionality.
ir_helpers/mod.rs
andcoercer/field_type.rs
.distribute_constraints
,type_has_constraints
, andtype_has_checks
inir_helpers/mod.rs
.integ-tests/typescript/tests/integ-tests.test.ts
.Cargo.toml
andCargo.lock
to includeitertools
dependency.BamlValueWithMeta
serialization inbaml_value.rs
.This description was created by for d21f1aa. It will automatically update as commits are pushed.