Refractored code to remove explicit conversion#140
Refractored code to remove explicit conversion#140Saurabhdarekar wants to merge 7 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes explicit int64 to float64 conversions in response to an upstream adapter-framework change that now supports native int64 processing. The change simplifies the codebase by allowing int64 attributes to be parsed directly without conversion to float64.
Key changes:
- Updated parsing logic to handle Int64 and Double attribute types separately
- Modified test expectations to reflect native int64 values instead of float64
- Updated error messages to reflect correct type handling
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/my-sql/datasource.go | Separated Int64 and Double parsing with appropriate strconv functions |
| pkg/my-sql/adapter_test.go | Updated error message expectation for Int64 parsing |
| pkg/ldap/datasource.go | Changed from ParseFloat to ParseInt for Int64 attributes |
| pkg/bamboohr/datasource.go | Separated Int64 and Double parsing logic |
| pkg/bamboohr/datasource_test.go | Updated test expectations from float64 to int64 values |
| pkg/aws-s3/csv.go | Added separate Int64 parsing case with appropriate error messaging |
| pkg/aws-s3/* test files | Updated test data and expectations for int64 handling |
| go.mod | Updated adapter-framework dependency version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@claude review the PR |
|
Claude finished @Saurabhdarekar's task —— View job PR Review: Refactored code to remove explicit conversionReview Progress:
SummaryThis PR successfully removes explicit int64 to float64 conversions by updating to adapter-framework v0.18.1-0.20250904145911-30a11c0a6f11. The changes are clean and consistent across all adapters. Key Changes Reviewed1. Dependency Update (go.mod:21)
2. Core Parsing Logic Improvements
3. Test Updates
Technical AssessmentStrengths:
Code Quality:
RecommendationsThis PR is ready for merge. The implementation is:
The refactoring successfully addresses the original requirement to remove explicit int64→float64 conversions while maintaining type safety and proper error handling. |
nholbrook
left a comment
There was a problem hiding this comment.
Core logic LGTM. A few nits, but these can be addressed as a followup.
One important point I want to make sure we've discussed before releasing this to PROD: have we done investigation / sufficient testing to ensure this won't cause any regressions?
With this PR, across multiple SoRs, we'll be changing the default behavior for new AND existing SoRs. This means that any existing nodes affected by this change will have the datatype of some of their fields changed (and potentially the value). If we have any customers relying on this field being a float (or if we have any fields that are specified as Ints but actually being provided as Floats, we could see a regression).
I'll raise this as a discussion topic in standup so we determine if we're fine merging this as-is or if we want to change how we roll out this change
|
There is an investigation needed as Nick mentioned before merging this PR |
Description of changes
As per the change to adapter-framework the requirement to explicitly convert any int64 value to float64 has been resolved. This PR removes the explicit conversion that was done in this repo to remove the ambiguous code.
API References
Pull request intention
Pull request checklist