Skip to content

Conversation

@AsafMah
Copy link
Contributor

@AsafMah AsafMah commented May 18, 2025

Fixed

  • Fixed parsing of empty strings

#310

Copy link
Contributor

Copilot AI left a 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 == "" {

Copy link
Contributor

Copilot AI left a 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 QuoteString so "" is generated for empty inputs
  • Added a unit test for a visible empty string literal
  • Updated CHANGELOG.md to 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(""),

@github-actions
Copy link

github-actions bot commented May 18, 2025

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 5be1658. ± Comparison against base commit 10a2eb2.

♻️ This comment has been updated with latest results.

Co-authored-by: Copilot <[email protected]>
@AsafMah AsafMah merged commit ea41a05 into master May 18, 2025
6 checks passed
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.

2 participants