Skip to content

Conversation

@ericpan64
Copy link
Owner

@ericpan64 ericpan64 commented Nov 26, 2025

Summary by cubic

Added tests for transforming between nested A.json and flat B.json to validate mapper/grab behavior, name parsing, address formatting, and partial roundtrip with known limitation on previous addresses.

  • Dependencies
    • Bumped chidian version to 0.2.1 in pyproject.toml and uv.lock.

Written for commit dd4d244. Summary will update automatically on new commits.

@ericpan64 ericpan64 merged commit 2fa25ef into main Nov 26, 2025
1 check passed
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="tests/test_a_b_example.py">

<violation number="1" location="tests/test_a_b_example.py:72">
parse_address assumed all three trailing lines exist for city/postal/country, so addresses missing any of those fields drop street lines and mislabel the remaining data when converting B → A. Update the helper (and its duplicate in the roundtrip test) to only strip as many trailing components as are actually consumed.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

# Last 3 lines are city, postal_code, country
# Everything before is street
return {
"street": lines[:-3],
Copy link

@cubic-dev-ai cubic-dev-ai bot Nov 26, 2025

Choose a reason for hiding this comment

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

parse_address assumed all three trailing lines exist for city/postal/country, so addresses missing any of those fields drop street lines and mislabel the remaining data when converting B → A. Update the helper (and its duplicate in the roundtrip test) to only strip as many trailing components as are actually consumed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/test_a_b_example.py, line 72:

<comment>parse_address assumed all three trailing lines exist for city/postal/country, so addresses missing any of those fields drop street lines and mislabel the remaining data when converting B → A. Update the helper (and its duplicate in the roundtrip test) to only strip as many trailing components as are actually consumed.</comment>

<file context>
@@ -0,0 +1,198 @@
+            # Last 3 lines are city, postal_code, country
+            # Everything before is street
+            return {
+                &quot;street&quot;: lines[:-3],
+                &quot;city&quot;: lines[-3] if len(lines) &gt;= 3 else None,
+                &quot;postal_code&quot;: lines[-2] if len(lines) &gt;= 2 else None,
</file context>
Fix with Cubic

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