[ 
https://issues.apache.org/jira/browse/BEAM-13051?focusedWorklogId=714046&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-714046
 ]

ASF GitHub Bot logged work on BEAM-13051:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Jan/22 21:37
            Start Date: 24/Jan/22 21:37
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on a change in pull request #16526:
URL: https://github.com/apache/beam/pull/16526#discussion_r791170279



##########
File path: sdks/python/apache_beam/io/external/xlang_kinesisio_it_test.py
##########
@@ -267,10 +267,10 @@ def create_stream(self, stream_name):
         )
         time.sleep(2)
         break
-      except:  # pylint: disable=bare-except
+      except Exception as e:
         if i == retries - 1:
           logging.error('Could not create kinesis stream')
-          raise
+          raise e

Review comment:
       lgtm

##########
File path: sdks/python/apache_beam/io/external/xlang_kinesisio_it_test.py
##########
@@ -290,7 +290,7 @@ def get_first_shard_id(self, stream_name):
       time.sleep(2)
       if i == retries - 1:
         logging.error('Could not initialize kinesis stream')
-        raise
+        raise RuntimeError()

Review comment:
       ```suggestion
           raise RuntimeError("Unable to initialize Kinesis Stream %s. Status: 
%s",
               stream['StreamDescription']['StreamName'], 
stream['StreamDescription']['StreamStatus'])
   ```

##########
File path: sdks/python/apache_beam/runners/common.py
##########
@@ -1262,7 +1262,7 @@ def finalize(self):
 
   def _reraise_augmented(self, exn):
     if getattr(exn, '_tagged_with_step', False) or not self.step_name:
-      raise
+      raise exn

Review comment:
       lgtm

##########
File path: sdks/python/apache_beam/runners/portability/portable_runner.py
##########
@@ -628,12 +628,10 @@ def _cleanup(self, on_exit=False):
           '  with Pipeline() as p:\n'
           '    p.apply(..)\n'
           'This ensures that the pipeline finishes before this program exits.')
-    has_exception = None
     for callback in self._cleanup_callbacks:
       try:
         callback()
-      except Exception:
-        has_exception = True
-    self._cleanup_callbacks = ()
-    if has_exception:
-      raise
+      except Exception as e:
+        raise e
+      finally:
+        self._cleanup_callbacks = ()

Review comment:
       this code has slightly different behavior, right? The new code may not 
call all of the cleanup callbacks. If one of them errors out before the end, 
then the final callbacks will not be processed, right?
   
   Maybe you can store all exceptions, and raise a RuntimeException with 
information about all of them?




-- 
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: [email protected]

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 714046)
    Time Spent: 9h 10m  (was: 9h)

> Enable all practical pylint warnings
> ------------------------------------
>
>                 Key: BEAM-13051
>                 URL: https://issues.apache.org/jira/browse/BEAM-13051
>             Project: Beam
>          Issue Type: Task
>          Components: sdk-py-core
>            Reporter: Brian Hulette
>            Assignee: Mike Hernandez
>            Priority: P2
>          Time Spent: 9h 10m
>  Remaining Estimate: 0h
>
> We currently have 75 pylint checks disabled globally: 
> https://github.com/apache/beam/blob/0863d95205410567a7ab191fd0a46308a0d54bb7/sdks/python/.pylintrc#L81
> I think some of these are impractical for Beam (e.g. 
> [super-init-not-called|https://pycodequ.al/docs/pylint-messages/w0231-super-init-not-called.html]
>  because of BEAM-6158), but most of them are verifying good conventions that 
> we should try to stick to. Let's enable as many of the checks as possible, 
> such that the only disabled checks are really impractical for Beam, or are 
> incompatible with the Beam community's coding style.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to