[
https://issues.apache.org/jira/browse/AVRO-3484?focusedWorklogId=760980&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-760980
]
ASF GitHub Bot logged work on AVRO-3484:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Apr/22 17:47
Start Date: 22/Apr/22 17:47
Worklog Time Spent: 10m
Work Description: martin-g commented on PR #1651:
URL: https://github.com/apache/avro/pull/1651#issuecomment-1106731745
Runtime!
I wasn't aware that quoted code is executed at runtime!
Quick try didn't work. Again complains about ToTokens...
On Fri, Apr 22, 2022, 03:44 Jack Klamer ***@***.***> wrote:
> ***@***.**** commented on this pull request.
>
> 👍 Nice! great testing too.
> ------------------------------
>
> In lang/rust/avro_derive/src/lib.rs
> <https://github.com/apache/avro/pull/1651#discussion_r855686031>:
>
> >
FieldOptions::from_attributes(&field.attrs[..]).map_err(darling_to_syn)?;
>
> - let doc = preserve_optional(field_documented.doc);
>
> + let doc = preserve_optional(field_attrs.doc);
>
> + let default_value = match field_attrs.default {
>
> + Some(default_value) => {
>
> + quote! {
>
>
> NIT: I would prefer to run serde_json::from_str(#default_value) here and
> throw an error if invalid. To avoid runtime errors.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/avro/pull/1651#pullrequestreview-949335544>,
> or unsubscribe
>
<https://github.com/notifications/unsubscribe-auth/AABYUQVSSLLUFT5F3FOVSSLVGHZADANCNFSM5TZSKMKQ>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
Issue Time Tracking
-------------------
Worklog Id: (was: 760980)
Time Spent: 50m (was: 40m)
> Rust: Implement derive default via annotation
> ---------------------------------------------
>
> Key: AVRO-3484
> URL: https://issues.apache.org/jira/browse/AVRO-3484
> Project: Apache Avro
> Issue Type: Improvement
> Reporter: Jack Klamer
> Assignee: Martin Tzvetanov Grigorov
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.11.1, 1.12.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Origin Comment: https://github.com/apache/avro/pull/1631#discussion_r845826110
> Follow up on the avro derive work. Will want to be able to set the default
> for a field inside a struct using annotations
--
This message was sent by Atlassian Jira
(v8.20.7#820007)