kszucs commented on a change in pull request #8088:
URL: https://github.com/apache/arrow/pull/8088#discussion_r488226798



##########
File path: cpp/src/arrow/python/python_to_arrow.cc
##########
@@ -1347,64 +841,49 @@ Status ConvertToSequenceAndInferSize(PyObject* obj, 
PyObject** seq, int64_t* siz
   return Status::OK();
 }
 
-Status ConvertPySequence(PyObject* sequence_source, PyObject* mask,
-                         const PyConversionOptions& options,
-                         std::shared_ptr<ChunkedArray>* out) {
+Result<std::shared_ptr<Array>> ConvertPySequence(PyObject* obj, PyObject* mask,
+                                                 const PyConversionOptions& 
opts) {
   PyAcquireGIL lock;
 
   PyObject* seq;
   OwnedRef tmp_seq_nanny;
+  PyConversionOptions options = opts;  // copy options struct since we modify 
it below
 
   std::shared_ptr<DataType> real_type;
 
   int64_t size = options.size;
-  RETURN_NOT_OK(ConvertToSequenceAndInferSize(sequence_source, &seq, &size));
+  RETURN_NOT_OK(ConvertToSequenceAndInferSize(obj, &seq, &size));
   tmp_seq_nanny.reset(seq);
 
   // In some cases, type inference may be "loose", like strings. If the user
   // passed pa.string(), then we will error if we encounter any non-UTF8
   // value. If not, then we will allow the result to be a BinaryArray
-  bool strict_conversions = false;
+  auto copied_options = options;
+  options.strict = false;
 
   if (options.type == nullptr) {
     RETURN_NOT_OK(InferArrowType(seq, mask, options.from_pandas, &real_type));
-    if (options.ignore_timezone && real_type->id() == Type::TIMESTAMP) {
-      const auto& ts_type = checked_cast<const TimestampType&>(*real_type);
-      real_type = timestamp(ts_type.unit());
-    }
+    // TODO(kszucs): remove this
+    // if (options.ignore_timezone && real_type->id() == Type::TIMESTAMP) {
+    //   const auto& ts_type = checked_cast<const TimestampType&>(*real_type);
+    //   real_type = timestamp(ts_type.unit());
+    // }

Review comment:
       The spark integration tests, we need to run those.




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

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


Reply via email to