-
Notifications
You must be signed in to change notification settings - Fork 45
Fix empty string #309
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
Fix empty string #309
Conversation
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.
Pull Request Overview
This pull request fixes the handling of empty strings in the KQL query builder so that they are correctly parsed and represented.
- Removed an early return for empty strings in QuoteString to allow proper quoting.
- Added a test case validating that empty strings are quoted as expected.
- Updated dependency hashes and the CHANGELOG to reflect the changes.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| go.work.sum | Updated module hashes with new dependency versions. |
| azkustodata/kql/string_utils.go | Removed early return for empty strings, so they are properly quoted. |
| azkustodata/kql/builder_test.go | Added a new test case to verify the correct quoting of empty strings. |
| CHANGELOG.md | Updated changelog with the empty string parsing fix. |
Comments suppressed due to low confidence (1)
azkustodata/kql/string_utils.go:28
- Removing the early return for empty strings ensures they are quoted as expected; please verify that QuoteString now produces the desired quoted output for empty strings.
if value == "" {
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.
Pull Request Overview
This PR ensures empty strings are quoted correctly rather than returned unmodified.
- Removed special‐case early return in
QuoteStringso""is generated for empty inputs - Added a unit test for a visible empty string literal
- Updated
CHANGELOG.mdto document the fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| azkustodata/kql/string_utils.go | Removed if value == "" branch so empty strings get quoted |
| azkustodata/kql/builder_test.go | Added test case verifying AddString("") yields "" |
| CHANGELOG.md | Added “Fixed parsing of empty strings” under Unreleased |
Comments suppressed due to low confidence (1)
azkustodata/kql/builder_test.go:134
- Consider adding a test for the hidden case (e.g.,
.AddString("", hidden=true)) to ensure empty strings are handled correctly when hidden is enabled.
New(`myTable | where col = `).AddString(""),
Co-authored-by: Copilot <[email protected]>
Fixed
#310