santiment / sanpy

Santiment API Python Client
MIT License
96 stars 29 forks source link

Code-review: refactoring by Ilya Paulouski #173

Closed ivpavlovskiy closed 8 months ago

ivpavlovskiy commented 1 year ago

Code review for interview by Ilya Paulouski.

Changes:

  1. Removed some of unused imports but not all.
  2. Refactored san\execute_sql.py
    • Moved some kwargs param to params of the function for better readability.
    • Moved index validation before initializing DataFrame in __transform_sql_result
    • Updated doc with function arguments.
  3. Refactored san\graphql.py
    • created __execute_gql__ and __handle_fail_response__ to avoid code copy-pasting
  4. Refactored san/pandas_utils.py
    • Removed inplace argument from method as it's bad practice to use inplace with Pandas.