You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/02/06 18:19:35 UTC

[GitHub] [arrow] emkornfield opened a new pull request #12348: ARROW-15080: Enable tuples conversion to interval

emkornfield opened a new pull request #12348:
URL: https://github.com/apache/arrow/pull/12348


   Allows tuples to be converted to MonthDayNanoInterval
   when type is explicitly specified.
   
   Also, add missing branch for intervals to strategy.py


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] ursabot edited a comment on pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031830087


   Benchmark runs are scheduled for baseline = 06d0e650080a262146cbe5cdba2598390625ed1f and contender = 501d92e620cc180501d17774468df547b58b45a3. 501d92e620cc180501d17774468df547b58b45a3 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/c195414a45de41188588c9273f9ea7cc...a6e12d39dd7f4c1292d97cf0e981f558/)
   [Scheduled] [test-mac-arm](https://conbench.ursa.dev/compare/runs/bee66fd0bbbf490c82c390f3a5bf57c3...f3956b65ef034e60b524b39158fe9c80/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/ef2c0e0ff62846b5ba1d081e71ddb665...876a210678674249b81f88727f70f46a/)
   [Finished :arrow_down:0.91% :arrow_up:0.13%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/30f72c627f884350acb80218213467b6...8d49ee53b2ca470ab4627421d919ae99/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] emkornfield commented on a change in pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
emkornfield commented on a change in pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#discussion_r800908996



##########
File path: cpp/src/arrow/python/python_to_arrow.cc
##########
@@ -416,8 +416,18 @@ class PyValue {
     }
     RETURN_NOT_OK(PopulateMonthDayNano<MonthDayNanoField::kNanoseconds>::Field(
         obj, &output.nanoseconds, &found_attrs));
-
     if (ARROW_PREDICT_FALSE(!found_attrs) && !is_date_offset) {
+      if (PyTuple_Check(obj) && PyTuple_Size(obj) == 3) {
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 0), &output.months,
+                                               "Months (Index 0) index to large"));
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 1), &output.days,
+                                               "Days (Index 1) index to large"));
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 2),
+                                               &output.nanoseconds,
+                                               "Nanoseconds (Index 2) index to large"));
+        return output;
+      }
+
       // date_offset can have zero fields.

Review comment:
       yep




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] pitrou closed pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
pitrou closed pull request #12348:
URL: https://github.com/apache/arrow/pull/12348


   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] ursabot commented on pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
ursabot commented on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031830087


   Benchmark runs are scheduled for baseline = 06d0e650080a262146cbe5cdba2598390625ed1f and contender = 501d92e620cc180501d17774468df547b58b45a3. 501d92e620cc180501d17774468df547b58b45a3 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Scheduled] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/c195414a45de41188588c9273f9ea7cc...a6e12d39dd7f4c1292d97cf0e981f558/)
   [Scheduled] [test-mac-arm](https://conbench.ursa.dev/compare/runs/bee66fd0bbbf490c82c390f3a5bf57c3...f3956b65ef034e60b524b39158fe9c80/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/ef2c0e0ff62846b5ba1d081e71ddb665...876a210678674249b81f88727f70f46a/)
   [Scheduled] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/30f72c627f884350acb80218213467b6...8d49ee53b2ca470ab4627421d919ae99/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] emkornfield commented on pull request #12348: ARROW-15080: Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
emkornfield commented on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031037988


   CI failure looks unrelated (TestS3FSGeneric.DeleteRootDirContents on ARM)


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] emkornfield commented on pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
emkornfield commented on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031733929


   CC @pitrou 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] emkornfield commented on pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
emkornfield commented on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031763569


   @github-actions autotune everything
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] ursabot edited a comment on pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031830087


   Benchmark runs are scheduled for baseline = 06d0e650080a262146cbe5cdba2598390625ed1f and contender = 501d92e620cc180501d17774468df547b58b45a3. 501d92e620cc180501d17774468df547b58b45a3 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/c195414a45de41188588c9273f9ea7cc...a6e12d39dd7f4c1292d97cf0e981f558/)
   [Scheduled] [test-mac-arm](https://conbench.ursa.dev/compare/runs/bee66fd0bbbf490c82c390f3a5bf57c3...f3956b65ef034e60b524b39158fe9c80/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/ef2c0e0ff62846b5ba1d081e71ddb665...876a210678674249b81f88727f70f46a/)
   [Scheduled] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/30f72c627f884350acb80218213467b6...8d49ee53b2ca470ab4627421d919ae99/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #12348: ARROW-15080: Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1030886309






-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] ursabot edited a comment on pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031830087


   Benchmark runs are scheduled for baseline = 06d0e650080a262146cbe5cdba2598390625ed1f and contender = 501d92e620cc180501d17774468df547b58b45a3. 501d92e620cc180501d17774468df547b58b45a3 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/c195414a45de41188588c9273f9ea7cc...a6e12d39dd7f4c1292d97cf0e981f558/)
   [Finished :arrow_down:0.26% :arrow_up:0.0%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/bee66fd0bbbf490c82c390f3a5bf57c3...f3956b65ef034e60b524b39158fe9c80/)
   [Finished :arrow_down:1.07% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/ef2c0e0ff62846b5ba1d081e71ddb665...876a210678674249b81f88727f70f46a/)
   [Finished :arrow_down:0.91% :arrow_up:0.13%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/30f72c627f884350acb80218213467b6...8d49ee53b2ca470ab4627421d919ae99/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] pitrou commented on a change in pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
pitrou commented on a change in pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#discussion_r800901189



##########
File path: cpp/src/arrow/python/python_to_arrow.cc
##########
@@ -416,8 +416,18 @@ class PyValue {
     }
     RETURN_NOT_OK(PopulateMonthDayNano<MonthDayNanoField::kNanoseconds>::Field(
         obj, &output.nanoseconds, &found_attrs));
-
     if (ARROW_PREDICT_FALSE(!found_attrs) && !is_date_offset) {
+      if (PyTuple_Check(obj) && PyTuple_Size(obj) == 3) {
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 0), &output.months,
+                                               "Months (Index 0) index to large"));
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 1), &output.days,
+                                               "Days (Index 1) index to large"));
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 2),
+                                               &output.nanoseconds,
+                                               "Nanoseconds (Index 2) index to large"));
+        return output;
+      }
+
       // date_offset can have zero fields.

Review comment:
       Move this comment before the enclosing `if`?

##########
File path: cpp/src/arrow/python/python_to_arrow.cc
##########
@@ -416,8 +416,18 @@ class PyValue {
     }
     RETURN_NOT_OK(PopulateMonthDayNano<MonthDayNanoField::kNanoseconds>::Field(
         obj, &output.nanoseconds, &found_attrs));
-
     if (ARROW_PREDICT_FALSE(!found_attrs) && !is_date_offset) {
+      if (PyTuple_Check(obj) && PyTuple_Size(obj) == 3) {
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 0), &output.months,
+                                               "Months (Index 0) index to large"));
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 1), &output.days,
+                                               "Days (Index 1) index to large"));
+        RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 2),
+                                               &output.nanoseconds,
+                                               "Nanoseconds (Index 2) index to large"));

Review comment:
       Wording suggestion:
   ```suggestion
           RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 0), &output.months,
                                                  "Months (tuple item #0) too large"));
           RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 1), &output.days,
                                                  "Days (tuple item #1) too large"));
           RETURN_NOT_OK(internal::CIntFromPython(PyTuple_GET_ITEM(obj, 2),
                                                  &output.nanoseconds,
                                                  "Nanoseconds (tuple item #2) too large"));
   ```




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] ursabot edited a comment on pull request #12348: ARROW-15080: [Python][C++] Enable tuples conversion to interval

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #12348:
URL: https://github.com/apache/arrow/pull/12348#issuecomment-1031830087


   Benchmark runs are scheduled for baseline = 06d0e650080a262146cbe5cdba2598390625ed1f and contender = 501d92e620cc180501d17774468df547b58b45a3. 501d92e620cc180501d17774468df547b58b45a3 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/c195414a45de41188588c9273f9ea7cc...a6e12d39dd7f4c1292d97cf0e981f558/)
   [Finished :arrow_down:0.26% :arrow_up:0.0%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/bee66fd0bbbf490c82c390f3a5bf57c3...f3956b65ef034e60b524b39158fe9c80/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/ef2c0e0ff62846b5ba1d081e71ddb665...876a210678674249b81f88727f70f46a/)
   [Finished :arrow_down:0.91% :arrow_up:0.13%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/30f72c627f884350acb80218213467b6...8d49ee53b2ca470ab4627421d919ae99/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org