Maxim Martynov created ATLAS-4658:
-------------------------------------

             Summary: base_client.py implementation is a bit messy
                 Key: ATLAS-4658
                 URL: https://issues.apache.org/jira/browse/ATLAS-4658
             Project: Atlas
          Issue Type: Improvement
          Components: atlas-intg
    Affects Versions: 2.1.0
            Reporter: Maxim Martynov


atlas_client/client/base_client.py looks a bit messy:

https://github.com/apache/atlas/blob/c1daaa44c3833be31c006753a2cf2f6f2e476cdc/intg/src/main/python/apache_atlas/client/base_client.py#L79-L120
 # There is no need to make conditions with mapping between HTTPMethod enum 
values and corresponding {{requests.Session}} methods - there is a 
{{requests.Session.request}} method which accepts HTTP method as argument
 # There is no need to use {{elif}} in conditions if previous clauses are ended 
with {{return}} or {{raise}} statements
 # There is not need to use {{logger.isEnabledFor(logging.DEBUG)}} before 
calling {{{}logger.debug{}}}, this is already done in {{.debug}} method itself
 # Use {{{}logging{}}}, not {{print}}
 # {{{{logging.exception}}}} already shows full exception traceback, no need to 
explicitly show add it into a logging message


 

I've creates pull request with a fix for all these items:

https://github.com/apache/atlas/pull/158/files



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to