You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/16 11:32:17 UTC

[GitHub] [iceberg] Fokko opened a new pull request, #5546: Python: Add wrapper to throw the exit code

Fokko opened a new pull request, #5546:
URL: https://github.com/apache/iceberg/pull/5546

   Make handling the exit codes a bit nicer. It was all over the place, now it is being done by a decorator that catches the exception. We cannot use the default way of Click and just throw an exception because we need to either format it as plain text or as JSON.


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] rdblue merged pull request #5546: Python: Add wrapper to throw the exit code

Posted by GitBox <gi...@apache.org>.
rdblue merged PR #5546:
URL: https://github.com/apache/iceberg/pull/5546


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] rdblue commented on a diff in pull request #5546: Python: Add wrapper to throw the exit code

Posted by GitBox <gi...@apache.org>.
rdblue commented on code in PR #5546:
URL: https://github.com/apache/iceberg/pull/5546#discussion_r950393587


##########
python/pyiceberg/cli/console.py:
##########
@@ -36,6 +37,23 @@
 SUPPORTED_CATALOGS: Dict[str, Type[Catalog]] = {"thrift": HiveCatalog, "http": RestCatalog}
 
 
+def catch_exception(func=None):
+    if not func:
+        return partial(catch_exception)

Review Comment:
   I don't quite understand what's happening with this decorator. The wrapper part makes sense to me.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] rdblue commented on pull request #5546: Python: Add wrapper to throw the exit code

Posted by GitBox <gi...@apache.org>.
rdblue commented on PR #5546:
URL: https://github.com/apache/iceberg/pull/5546#issuecomment-1220891869

   Looks good to me. Just need to fix the conflicts.


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] Fokko commented on a diff in pull request #5546: Python: Add wrapper to throw the exit code

Posted by GitBox <gi...@apache.org>.
Fokko commented on code in PR #5546:
URL: https://github.com/apache/iceberg/pull/5546#discussion_r950535720


##########
python/pyiceberg/cli/console.py:
##########
@@ -36,6 +37,23 @@
 SUPPORTED_CATALOGS: Dict[str, Type[Catalog]] = {"thrift": HiveCatalog, "http": RestCatalog}
 
 
+def catch_exception(func=None):
+    if not func:
+        return partial(catch_exception)

Review Comment:
   I've just cleaned this up. This was a WIP and is required if you want to pass additional arguments along the decorator. This is easy by creating a partial that already binds the arguments. But this is actually not required. I've resolved the conflicts and simplified this code a bit.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] rdblue commented on a diff in pull request #5546: Python: Add wrapper to throw the exit code

Posted by GitBox <gi...@apache.org>.
rdblue commented on code in PR #5546:
URL: https://github.com/apache/iceberg/pull/5546#discussion_r950393587


##########
python/pyiceberg/cli/console.py:
##########
@@ -36,6 +37,23 @@
 SUPPORTED_CATALOGS: Dict[str, Type[Catalog]] = {"thrift": HiveCatalog, "http": RestCatalog}
 
 
+def catch_exception(func=None):
+    if not func:
+        return partial(catch_exception)

Review Comment:
   I don't quite understand what's happening with this decorator. The wrapper part makes sense to me. Can you help me understand what the purpose of this extra code is?



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org