jrxFive / python-nomad

Client library Hashicorp Nomad
https://python-nomad.readthedocs.io/en/latest/
MIT License
139 stars 73 forks source link

Add missing parameters, do not pass None #144

Closed Kamilcuk closed 1 year ago

Kamilcuk commented 1 year ago

Add missing parameters to allocations.get_allocations and jobs.get_jobs. Do not pass prefix if it's none (or any other param). This simplifies the code handling with optional parameters. If prefix is passed "", then allocations are sorted alphabetically, otherwise chronologically.

codecov-commenter commented 1 year ago

Codecov Report

Merging #144 (155225c) into master (78452b6) will decrease coverage by 0.09%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
- Coverage   90.67%   90.58%   -0.10%     
==========================================
  Files          31       31              
  Lines        1287     1285       -2     
==========================================
- Hits         1167     1164       -3     
- Misses        120      121       +1     
Impacted Files Coverage Δ
nomad/api/allocations.py 100.00% <100.00%> (ø)
nomad/api/base.py 94.31% <100.00%> (-1.14%) :arrow_down:
nomad/api/jobs.py 89.79% <100.00%> (-0.21%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Kamilcuk commented 1 year ago

I am under the influence of sqlalchemy which uses in_ with a trailing _. Leading _ suggests an internal symbol.

nikita-b commented 1 year ago

@Kamilcuk Yep, it seems you are right: https://peps.python.org/pep-0008/

_single_leading_underscore: weak “internal use” indicator. E.g. from M import * does not import objects whose names start with an underscore.
single_trailing_underscore_: used by convention to avoid conflicts with Python keyword, e.g.

LGTM