You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Madhan Neethiraj (Jira)" <ji...@apache.org> on 2023/06/05 19:28:00 UTC
[jira] [Assigned] (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:all-tabpanel ]
Madhan Neethiraj reassigned ATLAS-4658:
---------------------------------------
Assignee: Maxim Martynov
> 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
> Assignee: Maxim Martynov
> Priority: Major
> Fix For: 3.0.0, 2.4.0
>
> 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)