| 371 | } |
| 372 | |
| 373 | Status Decode(const uint8_t* data, uint32_t size, bool quoted, value_type* out) { |
| 374 | bool zone_offset_present = false; |
| 375 | if (ARROW_PREDICT_FALSE( |
| 376 | !internal::ParseTimestampISO8601(reinterpret_cast<const char*>(data), size, |
| 377 | unit_, out, &zone_offset_present))) { |
| 378 | return GenericConversionError(type_, data, size); |
| 379 | } |
| 380 | if (zone_offset_present != expect_timezone_) { |
| 381 | if (expect_timezone_) { |
| 382 | return Status::Invalid("CSV conversion error to ", type_->ToString(), |
| 383 | ": expected a zone offset in '", |
| 384 | std::string(reinterpret_cast<const char*>(data), size), |
| 385 | "'. If these timestamps are in local time, parse them as " |
| 386 | "timestamps without timezone, then call assume_timezone."); |
| 387 | } else { |
| 388 | return Status::Invalid("CSV conversion error to ", type_->ToString(), |
| 389 | ": expected no zone offset in '", |
| 390 | std::string(reinterpret_cast<const char*>(data), size), |
| 391 | "'"); |
| 392 | } |
| 393 | } |
| 394 | return Status::OK(); |
| 395 | } |
| 396 | |
| 397 | protected: |
| 398 | TimeUnit::type unit_; |
nothing calls this directly
no test coverage detected