You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by GitBox <gi...@apache.org> on 2022/11/26 18:57:02 UTC

[GitHub] [avro] shaeqahmed opened a new pull request, #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

shaeqahmed opened a new pull request, #1985:
URL: https://github.com/apache/avro/pull/1985

   <!--
   
   *Thank you very much for contributing to Apache Avro - we are happy that you want to help us improve Avro. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Avro a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/AVRO/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "AVRO-XXXX: [component] Title of the pull request", where *AVRO-XXXX* should be replaced by the actual issue number. 
       The *component* is optional, but can help identify the correct reviewers faster: either the language ("java", "python") or subsystem such as "build" or "doc" are good candidates.  
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests. You can [build the entire project](https://github.com/apache/avro/blob/master/BUILD.md) or just the [language-specific SDK](https://avro.apache.org/project/how-to-contribute/#unit-tests).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Every commit message references Jira issues in their subject lines. In addition, commits follow the guidelines from [How to write a good git commit message](https://chris.beams.io/posts/git-commit/)
       1. Subject is separated from body by a blank line
       1. Subject is limited to 50 characters (not including Jira issue reference)
       1. Subject does not end with a period
       1. Subject uses the imperative mood ("add", not "adding")
       1. Body wraps at 72 characters
       1. Body explains "what" and "why", not "how"
   
   -->
   
   ## What is the purpose of the change
   
   This pull request adds support for validating/resolving a float value against a destination schema where the corresponding field is defined as a double, fixing AVRO-3678. This makes the behavior similar to how we currently support other lossless upcasting of numeric types, such as int -> long, which should be expected behavior.
   
   https://issues.apache.org/jira/browse/AVRO-3678
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   - Added tests that validates that a float value can be resolved & validated against a schema double field.
   
   
   ## Documentation
   
   - Does this pull request introduce a new feature? **no**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g commented on pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

Posted by GitBox <gi...@apache.org>.
martin-g commented on PR #1985:
URL: https://github.com/apache/avro/pull/1985#issuecomment-1328117318

   Please squash your commits and add `AVRO-3678: ` as a prefix for the commit message.
   At the moment there are 14 commits and most of them are merge commits.
   
   Also please address the clippy errors.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g commented on pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

Posted by GitBox <gi...@apache.org>.
martin-g commented on PR #1985:
URL: https://github.com/apache/avro/pull/1985#issuecomment-1331834053

   Closing in favour of https://github.com/apache/avro/pull/1991.
   It has clear commit history and solves the clippy errors.
   Thank you, @shaeqahmed !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g commented on a diff in pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

Posted by GitBox <gi...@apache.org>.
martin-g commented on code in PR #1985:
URL: https://github.com/apache/avro/pull/1985#discussion_r1032834511


##########
lang/rust/avro/src/types.rs:
##########
@@ -1565,6 +1570,12 @@ Field with name '"b"' is not a member of the map items"#,
         assert!(value.resolve(&Schema::TimestampMicros).is_err());
     }
 
+    #[test]
+    fn resolve_float_to_double() {

Review Comment:
   ```suggestion
       fn avro_3678_resolve_float_to_double() {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g closed pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

Posted by GitBox <gi...@apache.org>.
martin-g closed pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double
URL: https://github.com/apache/avro/pull/1985


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] martin-g commented on pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

Posted by GitBox <gi...@apache.org>.
martin-g commented on PR #1985:
URL: https://github.com/apache/avro/pull/1985#issuecomment-1328929077

   @shaeqahmed Please let me know if you need help with git and/or clippy!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] shaeqahmed commented on pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

Posted by GitBox <gi...@apache.org>.
shaeqahmed commented on PR #1985:
URL: https://github.com/apache/avro/pull/1985#issuecomment-1328097698

   @martin-g This is my second time opening a contribution to the Avro project, so please let me know if I should make any changes. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] shaeqahmed commented on pull request #1985: AVRO-3678: [Rust] Support writing float value to field defined as double

Posted by GitBox <gi...@apache.org>.
shaeqahmed commented on PR #1985:
URL: https://github.com/apache/avro/pull/1985#issuecomment-1332492677

   My bad for the delay, was travelling and got sick so didn't get the chance to address the comments till now. Looks like you fixed the minor issues and merged it, thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org