You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/06/21 19:07:37 UTC

[GitHub] [arrow-datafusion] alamb opened a new pull request, #6740: RFC: add error macros

alamb opened a new pull request, #6740:
URL: https://github.com/apache/arrow-datafusion/pull/6740

   Suggested by @comphead  on https://github.com/apache/arrow-datafusion/pull/6721/files#r1235622262
   
   I made some macros and then had trouble using them. Issues I ran into:
   
   1. The macros return `Result<..>` rather than `DataFusionError` so they can't be used in all places (e.g the one @comphead suggested in https://github.com/apache/arrow-datafusion/pull/6721/files#r1235622262)
   2. Many errors are created using `format!(...)` which I couldn't figure out how to make into a nice macro invocation
   
   Maybe someone else has some ideas


-- 
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-datafusion] alamb commented on pull request #6740: RFC: add error macros

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #6740:
URL: https://github.com/apache/arrow-datafusion/pull/6740#issuecomment-1649734902

   I have no plans to pursue this PR at this time, so closing it 


-- 
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-datafusion] alamb commented on pull request #6740: RFC: add error macros

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #6740:
URL: https://github.com/apache/arrow-datafusion/pull/6740#issuecomment-1605368931

   Sorry for the late reply @comphead 
   
   > @alamb let me know what do you think.
   
   I think it looks great to me. 
   
   > @alamb I can take all the findings and create a PR replacing all plan errors for now, if you think it is a right direction to go
   
   I think that would be good. Perhaps we you could make the macros and do a few changes and we can make sure it looks reasonable before spending the time to migrate the whole codebase?
   
   Thanks again @comphead 


-- 
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-datafusion] comphead commented on pull request #6740: RFC: add error macros

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on PR #6740:
URL: https://github.com/apache/arrow-datafusion/pull/6740#issuecomment-1601627769

   ```
   #[macro_export]
   macro_rules! plan_err {
       ($($arg:tt)*) => {{
           let res = format!($($arg)*);
           Err(datafusion_common::DataFusionError::Plan(res.into()))
       }}
   }
   ```
   
   ```
               if !val.is_null() {
                   plan_err!("value is not null {}", val)?
               }
   ```


-- 
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-datafusion] comphead commented on pull request #6740: RFC: add error macros

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on PR #6740:
URL: https://github.com/apache/arrow-datafusion/pull/6740#issuecomment-1603297725

   @alamb I can take all the findings and create a PR replacing all plan errors for now, if you think it is a right direction to go


-- 
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-datafusion] comphead commented on pull request #6740: RFC: add error macros

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on PR #6740:
URL: https://github.com/apache/arrow-datafusion/pull/6740#issuecomment-1601737993

   @alamb let me know what do you think.


-- 
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-datafusion] alamb closed pull request #6740: RFC: add error macros

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed pull request #6740: RFC: add error macros
URL: https://github.com/apache/arrow-datafusion/pull/6740


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