EnricoMi commented on code in PR #48626:
URL: https://github.com/apache/arrow/pull/48626#discussion_r2664568200


##########
python/pyarrow/src/arrow/python/inference.cc:
##########
@@ -309,6 +337,25 @@ class NumPyDtypeUnifier {
   int current_type_num() const { return current_type_num_; }
 
  private:
+  static const char* DatetimeUnitName(NPY_DATETIMEUNIT unit) {
+    switch (unit) {
+      case NPY_FR_s:
+        return "s";
+      case NPY_FR_ms:
+        return "ms";
+      case NPY_FR_us:
+        return "us";
+      case NPY_FR_ns:
+        return "ns";
+      case NPY_FR_D:
+        return "D";
+      case NPY_FR_GENERIC:
+        return "generic";
+      default:
+        return "unknown";

Review Comment:
   I think @rok's comment is still valid for `NPY_DATETIMEUNIT` values that are 
not enumerated here (added in the future to numpy but not added here). For 
those, the error message will show `unknown`. 
   
   Can we have something like `unknown (1234)` where `1234` is the string 
representation of the enum value `unit`?



-- 
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