candiduslynx commented on code in PR #35457:
URL: https://github.com/apache/arrow/pull/35457#discussion_r1187748838


##########
go/arrow/datatype_fixedwidth.go:
##########
@@ -325,6 +325,22 @@ func (u TimeUnit) Multiplier() time.Duration {
 
 func (u TimeUnit) String() string { return [...]string{"s", "ms", "us", 
"ns"}[uint(u)&3] }
 
+var _strToTimeUnit = map[string]TimeUnit{
+       "s":  Second,
+       "ms": Millisecond,
+       "us": Microsecond,
+       "ns": Nanosecond,
+}
+
+// TimeUnitFromString is the reverse of TimeUnit.String
+func TimeUnitFromString(s string) (TimeUnit, error) {
+       if v, ok := _strToTimeUnit[s]; ok {
+               return v, nil
+       }
+
+       return 0, fmt.Errorf("unsupported time unit: %q", s)
+}

Review Comment:
   Removed in 2bf65c58573f6ddbdc2e0f6fed13dd79516e6bac



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to