You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/06/05 19:20:00 UTC

[jira] [Commented] (ATLAS-4658) base_client.py implementation is a bit messy

    [ https://issues.apache.org/jira/browse/ATLAS-4658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17729432#comment-17729432 ] 

ASF subversion and git services commented on ATLAS-4658:
--------------------------------------------------------

Commit ad24235f492066378842cb0c1fbf9bde43da0391 in atlas's branch refs/heads/master from Maxim Martynov
[ https://gitbox.apache.org/repos/asf?p=atlas.git;h=ad24235f4 ]

ATLAS-4658: Python client - simply if clauses in AtlasClient.call_api

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


> 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
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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)