Skip to content

Conversation

@jentyk
Copy link
Contributor

@jentyk jentyk commented Dec 9, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved the LIST operator in query building to properly handle lists, tuples, and sets containing mixed data types. Previously, non-string elements would cause processing errors. The operator now converts all elements to strings before joining them, ensuring queries execute reliably regardless of element types in list-based values.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Walkthrough

A bug fix in the RQL query builder that improves LIST operator handling by converting all iterable elements to strings before joining them, preventing errors when non-string elements are present.

Changes

Cohort / File(s) Change Summary
LIST operator element handling
mpt_api_client/rql/query_builder.py
Modified LIST operator implementation in rql_encode to convert each element to string before joining with commas, replacing direct raw element joining

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file modification with straightforward string conversion logic
  • Fix is localized to LIST operator handling with minimal scope
  • No control flow changes or complex interactions

Possibly related PRs

Suggested reviewers

  • albertsola
  • d3rky
  • svazquezco
  • ruben-sebrango
  • robcsegal
  • alephsur

Poem

A rabbit hops through comma-joined arrays,
No more stumbling on non-string malaise,
With type conversion kindly in place,
LIST operators now run with grace,
🐰 Join rejoices, elements unite! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main bug fix: handling non-string elements in iterables within the query builder, which is exactly what the PR addresses.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/join

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Warnings
⚠️ PR title must include exactly one Jira issue key in the format MPT-XXXX.
⚠️

This PR modifies code (1 file(s)) but does not include any changes in the tests/ folder.

Please consider adding or updating tests to cover your changes.

Generated by 🚫 dangerJS against 34acb6d

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
mpt_api_client/rql/query_builder.py (1)

107-112: Keep list element encoding consistent with query_value_str

The change fixes the join failure for non-string elements, but str(el) bypasses the existing encoding rules (e.g., booleans become True/False instead of true/false). To keep scalar and list encodings consistent, consider delegating to query_value_str:

-    if op in constants.LIST and isinstance(value, list | tuple | set):
-        return ",".join(str(el) for el in value)
+    if op in constants.LIST and isinstance(value, list | tuple | set):
+        return ",".join(query_value_str(el) for el in value)

If sets are commonly used here, you may also want to normalize ordering (e.g., sorted(...)) for deterministic output, but that’s optional.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb022a9 and 34acb6d.

📒 Files selected for processing (1)
  • mpt_api_client/rql/query_builder.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

@robcsegal
Copy link
Contributor

Is there a jira task for this?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

Copy link
Contributor

@svazquezco svazquezco left a comment

Choose a reason for hiding this comment

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

I miss the test and #153 (comment)

@jentyk jentyk merged commit edf2b00 into main Dec 9, 2025
6 checks passed
@jentyk jentyk deleted the fix/join branch December 9, 2025 15:41
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.

4 participants